Integrating with Maven
There are two methods of integrating with the Tcat console's REST API from Maven. One uses the Maven Antrun Plug-in, and the other uses the Maven Publishing Plug-in. This page describes how to use each.
Maven Antrun Plug-in Continuous Deployment Integration
This method of integrating your Maven build with Tcat Server's REST API to achieve continuous deployment of your web applications uses the Maven Antrun Plugin to transfer your webapps into Tcat's console repository, and then trigger a deployment of the new webapp version.
For a complete and working example of a Maven POM file that you can download and try, download the Tcat Maven antrun plugin example zip file and unpack it. The POM file XML that performs the continuous deployment looks like this:
You can edit this XML to configure it to change the behavior, such as building and inserting your own webapp version strings, etc.
Maven Publishing Plug-in
If you create a Maven project, you can use the Galaxy Publishing plug-in for Maven to easily publish your project and/or its resources to a Tcat Server repository. To use the plug-in, you add the necessary Maven repositories to your Maven POM, and then configure the plug-in using the
<configuration> tags in your POM. The rest of this page describes these tasks.
After using the plug-in to update your applications, you can schedule a script to listen for these updates and automatically redeploy their packages. For an example, see Automatically Redeploying After an Artifact Update.
Adding the Tcat Server Repository to the POM
The first step is to add your Tcat Server repository (or snapshot repository) to your Maven POM. The Tcat Server repository includes the MuleForge repository, the Mule Dependencies repository, and the Apache Incubating repository. You add these to the
<pluginRepositories> section so that Maven knows where to get the required files:
Configuring the Plug-in
After adding the Maven repositories to the POM, you configure the plug-in as shown in the following example configuration, which publishes the generated WAR from Maven to your Tcat repository:
Configuring Security Information
If you do not want to include the user name and password in your POM, you can put it in your
~/.m2/settings.xml file. The file will look like this:
To use this security information, add the following tag to your plug-in configuration, replacing
myServer with the same ID you used in the
settings.xml file above:
Additional Configuration Options
For more options you can use in the
<configuration> section of the POM, see the generated documentation page.
|<< Previous: Using REST API to Manage Tcat Repository||Next: Release Notes >>|