Kwatee Maven Plugin version 4.0.2

Overview

This plugin can be used to automate kwatee operation during the maven lifecycle.

Goals Overview

Usage

To use the kwatee-maven-plugin you must first install it manually as follows:

cd kwatee distrib dir/addOns/maven
mvn install:install-file -Dfile=kwatee-maven-plugin-<version>.jar -DpomFile=pom.xml

The Kwatee Maven Plugin allows you to update a kwatee repository by creating/deleting artifact versions, uploading new packages to versions, and triggering deployment operations.

Examples

Goals

Goals available for this plugin:

Goal Description
kwatee:create_version Creates a new version within an existing kwatee artifacts.
kwatee:delete_version Deletes an artifact's version.
kwatee:upload_package Uploads a package to an existing artifact's version.
kwatee:set_active_version Sets the active version of an artifact in an environment's release.
kwatee:tag_release Tags an environment snapshot.
kwatee:delete_release Deletes an environment's release.
kwatee:deploy Deploy operations (deploy|undeploy|start|stop) on an environment's release.
kwatee:download_installer Download an installer for an environment's release.

kwatee:create_version

Communicates with a kwatee instance to create or duplicate a version within an existing artifact.

Required Parameters

NameDescription
serviceUrlbase URL of a kwatee instance. This must be of the form:
http://<user>:<password>@<host>:<port>/<kwateePath>
artifactthe artifact in which to create the new version.
versionthe name of the version to create.

Optional Parameters

NameDescription
duplicateFromthe name of the version to duplicate.
descriptionThe description of the newly created version.

kwatee:delete_version

Communicates with a kwatee instance to delete a version from an existing artifact.

Required Parameters

NameDescription
serviceUrlbase URL of a kwatee instance. This must be of the form:
http://<user>:<password>@<host>:<port>/<kwateePath>
artifactthe version's artifact name.
versionthe name of the version to delete.

kwatee:update_package

Communicate with a kwatee instance to upload an package (maven artifact) to a kwatee version.

Required Parameters

NameDescription
serviceUrlbase URL of a kwatee instance. This must be of the form:
http://<user>:<password>@<host>:<port>/<kwateePath>
artifactthe version's artifact.
versionthe name of the version in which to upload the package.
filethe path of the package to upload.

Optional Parameters

NameDescription
deleteOverlayswill delete existing overlays if true.

kwatee:set_active_version

Communicates with a kwatee instance to set the active version of a artifact in the snapshot release of the specified environment.

Required Parameters

NameDescription
serviceUrlbase URL of a kwatee instance. This must be of the form:
http://<user>:<password>@<host>:<port>/<kwateePath>
environmentthe environment name.
artifactthe artifact name for which to set the active version.
versionthe new active version name.

Optional Parameters

NameDescription
serverthe server to which the active version applies. If no server is specified, the active version will be the default for all servers in the environment.

kwatee:tag_release

Communicates with a kwatee instance to tag the snapshot release of the specified environment.

Required Parameters

NameDescription
serviceUrlbase URL of a kwatee instance. This must be of the form:
http://<user>:<password>@<host>:<port>/<kwateePath>
environmentthe environment name.
releasethe name of the tagged release to create.

Optional Parameters

NameDescription
descriptiona description for the tagged release.

kwatee:delete_release

Communicates with a kwatee instance to delete a release from the specified environment.

Required Parameters

NameDescription
serviceUrlbase URL of a kwatee instance. This must be of the form:
http://<user>:<password>@<host>:<port>/<kwateePath>
environmentthe release's environment name.
releasethe name of the release to delete.

kwatee:deploy

Communicates with a kwatee instance to trigger the deployment of a kwatee release and start/stop it's executables. To use it, declare:

Required Parameters

NameDescription
serviceUrlbase URL of a kwatee instance. This must be of the form:
http://<user>:<password>@<host>:<port>/<kwateePath>
environmentthe release's environment name.
releasethe name of the release on which to perform operations.
actionsa list of deployment operations to perform, specified as <param>action</param>...<param>action</param>, where action may be any of deploy|undeploy|start|stop.

Optional Parameters

NameDescription
releasethe name of the release on which to perform operations (default: snapshot).
artifactname of the release artifact to which the operation is applied (default: all artifacts).
servername of the release server to which the operation is applied (default: all servers).

kwatee:download_installer

Communicates with a kwatee instance to download an installer that is deployable with kwclideployer. To use it, declare:

Required Parameters

NameDescription
serviceUrlbase URL of a kwatee instance. This must be of the form:
http://<user>:<password>@<host>:<port>/<kwateePath>
environmentthe environment name.
fileThe file path of the downloaded installer file.

Optional Parameters

NameDescription
releasethe name of the release on which to perform operations (default: snapshot).

Examples

Create version and upload package

The demowebsite version 1.0 is duplicated to preserve version variables and overlays and then a new artifact is uploaded.

...
  <build>
    <plugins>
      ...
      <plugin>
        <groupId>net.kwatee.agiledeployment</groupId>
        <artifactId>kwatee-maven-plugin</artifactId>
        <version>4.0</version>
        <executions>
          <execution>
            <id>createVersion</id>
            <phase>package</phase>
            <goals>
              <goal>create_version</goal>
            </goals>
            <configuration>
              <serviceUrl>http://admin:password@kwatee.local:8080/kwatee</serviceUrl>
              <artifact>demowebsite</artifact>
              <version>1.1</version>
              <duplicateFrom>1.0</duplicateFrom>
              <description>created with maven</description>
            </configuration>
          </execution>
          <execution>
            <id>uploadPackage</id>
            <phase>package</phase>
            <goals>
              <goal>update_package</goal>
            </goals>
            <configuration>
              <serviceUrl>http://admin:password@kwatee.local:8080/kwatee</serviceUrl>
              <artifact>demowebsite</artifact>
              <version>1.1</version>
              <file>${project.build.directory}/${project.artifactId}.zip</file>
            </configuration>
          </execution>
        </executions>
      </plugin>
      ...
    </plugins>
  </build>
...

Set active version and tag

The environment's active version for demowebsite is updated to 1.1 and then the snapshot is tagged.

...
  <build>
    <plugins>
      ...
      <plugin>
        <groupId>net.kwatee.agiledeployment</groupId>
        <artifactId>kwatee-maven-plugin</artifactId>
        <version>1.0.1</version>
        <executions>
          <execution>
            <id>updateActiveVersion</id>
            <phase>package</phase>
            <goals>
              <goal>set_active_version</goal>
            </goals>
            <configuration>
              <serviceUrl>http://admin:password@kwatee.local:8080/kwatee</serviceUrl>
              <environment>intro</environment>
              <artifact>demowebsite</artifact>
              <version>1.1</version>
            </configuration>
          </execution>
          <execution>
            <id>tag</id>
            <phase>package</phase>
            <goals>
              <goal>tag_release</goal>
            </goals>
            <configuration>
              <serviceUrl>http://admin:password@kwatee.local:8080/kwatee</serviceUrl>
              <environment>intro</environment>
              <release>release1.1</release>
              <description>tagged by maven</description>
            </configuration>
          </execution>
        </executions>
      </plugin>
      ...
    </plugins>
  </build>
...

Download Installer

Stop a possible previous snapshot, deploy and start.

...
  <build>
    <plugins>
      ...
      <plugin>
        <groupId>net.kwatee.agiledeployment</groupId>
        <artifactId>kwatee-maven-plugin</artifactId>
        <version>4.0</version>
        <executions>
          <execution>
            <id>download_installer</id>
            <goals>
              <goal>download_installer</goal>
            </goals>
            <configuration>
              <serviceUrl>http://admin:password@kwatee.local:8080/kwatee</serviceUrl>
              <environment>intro</environment>
              <actions>
                <param>stop</param>
                <param>deploy</param>
                <param>start</param>
              </actions>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
...

Deploy

Downloads the installer of an environment's release.

...
  <build>
    <plugins>
      ...
      <plugin>
        <groupId>net.kwatee.agiledeployment</groupId>
        <artifactId>kwatee-maven-plugin</artifactId>
        <version>4.0</version>
        <executions>
          <execution>
            <id>deploy</id>
            <goals>
              <goal>deploy</goal>
            </goals>
            <phase>package</phase>
            <configuration>
              <serviceUrl>http://admin:password@kwatee.local:8080/kwatee</serviceUrl>
              <environment>intro</environment>
              <file>${project.build.directory}/intro_installer.tar.gz</file>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
...