Maven plugin use cases

1 minute readExtensibilityDeveloper productivity

The following use cases illustrate how you can use the Maven plugin to:

Retrieve a snapshot from Artifactory

In this example, the following snapshots are stored in Artifactory:

Artifactory snapshot
Figure 1. Artifactory snapshot

The maven-metadata.xml file contains the following content:

Maven metadata
Figure 2. Maven metadata XML

You can configure the Retrieve Artifact procedure to retrieve the WAR file artifact:

Configure the plugin procedure
Figure 3. Retrieve Artifact plugin procedure

When the procedure runs, the following log is produced for the artifact retrieval:

=============================================== Plugin Name : EC-Maven Plugin Version : 3.0.1.0 Procedure Name : Retrieve Artifact Step Name : Retrieve Artifact CloudBees CD version : 10.9.0.157496 FlowPDF-Per1 version : 1.5.2 =============================================== Got parameter "artifact" with value "maven-group:getting-started-tomcat" Got parameter "classifier" with value "" Got parameter "config" with value "/projects/CloudBees/pluginConfigurations/MavenConfig" Got parameter "directory" with value "/home/ecloud/" Got parameter "overwrite" with value "1" Got parameter "repository" with value "maven-repo" Got parameter "resultProperty" with value "" Got parameter "server" with value "" Got parameter "type" with value ".war" Got parameter "version" with value "" Fetching artifact... Source: http://10.30.231.215:8081/artifactory/maven-repo/maven-group/maven-artifact/1.0-SNAPSHOT/getting-started-tomcat-artifact-1.0.20170606.172748-1.war Destination: /home/ecloud//getting-started-tomcat-1.0.20170606.172748-1.war Success Retrieved artifact version: 1.0.0

Enable the debug log

To enable the debug log, use ectool to create a property for the Maven plugin:

ectool setProperty /projects/EC-Maven-<your-plugin-version>/debugLevel 2(1)
1 Replace your-plugin-version with the EC-Maven plugin version that you are using.

The higher the specified debugLevel, the more verbose the resulting job logs.