Usage

Basic Configuration

Provide login information in your settings.xml by specifying a server with username and password for the server that is responsible for the ci-management url.

<server>
  <id>hudson</id>
  <username>username</username>
  <password>password</password>
</server>

Provide a ciManagement in your pom.xml :

<ciManagement>
  <system>hudson</system>
  <url>http://....</url>
</ciManagement>

Note: The login information is selected by the ci-management server's name or by its URL (in that order).

Moreover a hudson job configuration is needed. There are two ways to create and configure one.

Download and than modify as appropriate a jobs config.xml from a hudson server e.g. via

scp www.example.com:/home/tomcatuser/.hudson/jobs/examplejob/config.xml

Use your browser to download and than modify one from e.g.

http://www.example.com/hudson/job/examplejob/config.xml
.

Copy this file to ${project.home}/src/ci/config.xml and configure the plugin by using this configuration:

<configuration>
  <ciServerId>hudsonId</ciServerId>
  <jobConfigFile>${project.home}/src/ci/config.xml</jobConfigFile>
  <jobName>jobname</jobName>
</configuration>
Than execute one of the jobs from below.

Create a ci-config.xml like this one:

<ci-config>
  <import-definitions>
    <import-definition id="default">
      <import>config</import>
    </import-definition>
  </import-definitions>
</ci-config>
It is possible to use multiple import-definition entries with more than one import entry. For each import-definition one job will be tampered. All files specified by an import will be merged in the order they are given. The last having the precedence. Even parent projects having a ci-config with the same id will be used. The name of the files must be the value of the import tag ending with .xml for the id default and with -$id.xml for any other import-definition e.g.: config-site.xml . The used jobName will be the projects name with the same id as postfix.

Advanced Configuration

Create hudson jobs

To add new hudson jobs on the ci-management system from the projects data, run:

mvn ${project.groupId}:${project.artifactId}:${project.version}:createJobs

Or add the following configuration to your POM:

<pluginManagement>
  <plugins>
    <plugin>
      <groupId>${project.groupId}</groupId>
      <artifactId>project.artifactId</artifactId>
      <version>${project.version}</version>
    </plugin>
  </plugins>
</pluginManagement>

With this configuration you may create new jobs on the hudson server without any arguments (short version):

mvn hudson:createJobs

Update hudson jobs

Analog to create jobs jobs can be updated by

mvn hudson:updateJobs

Delete hudson jobs

Analog to create jobs jobs can be deleted by

mvn hudson:deleteJobs

Enable hudson jobs

Analog to create jobs jobs can be enabled (if disabled) by

mvn hudson:enabledJobs

Disable hudson jobs

Analog to create jobs jobs can be disabled (if enabled) by

mvn hudson:disableJobs