jenkins:cli

Full name:

org.kuali.maven.plugins:jenkins-maven-plugin:1.2.6:cli

Description:

Connect to a Jenkins server and execute one or more Jenkins CLI commands.

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: test.
  • The goal is thread-safe and supports parallel builds.

Required Parameters

Name Type Since Description
cmd String - Jenkins CLI command to issue eg "help", "version", "who-ami-i", "build my-job -c -s" etc
Default value is: version.
User property is: jenkins.cmd.
excludeVersion boolean - If true, the version of the Maven project is not included in the job name
Default value is: true.
User property is: jenkins.excludeVersion.
failOnError boolean - If true, the Maven build will fail if Jenkins CLI returns a non-zero exit value, otherwise the Maven build will continue
Default value is: true.
User property is: jenkins.failOnError.
jobTypes String - Comma separated list of known job types. When specifying a job name these can be used as shorthand for the fully qualified job name. eg "publish" gets expanded to "jenkins-maven-plugin-publish". To turn off expansion set jobTypes to the empty string, null, or NONE
Default value is: publish,unit,license,release.
User property is: jenkins.jobTypes.
stopOnError boolean - If true, the build will fail the first time Jenkins CLI encounters an issue. When false, mojo's that issue multiple CLI requests, will proceed through their list of requests and then fail at the end if an issue was encountered along the way.
Default value is: false.
User property is: jenkins.stopOnError.
style String - The style of Jenkins job. Default styles are freestyle and maven. This parameter must be one of the default styles or match the name of a custom style supplied to the plugin
Default value is: freestyle.
User property is: jenkins.style.
successCodes String - Comma separated list of integers that represent a Jenkins CLI command completing successfully
Default value is: 0.
User property is: jenkins.successCodes.
timestampFormat String - The format for timestamp displays
Default value is: yyyy-MM-dd HH:mm:ss z.
User property is: jenkins.timestampFormat.
workingDir File - The working directory for the plugin
Default value is: ${project.build.directory}/jenkins.
User property is: jenkins.workingDir.

Optional Parameters

Name Type Since Description
commands List - List of commands to issue to Jenkins CLI eg "help", "version", "who-ami-i" etc If cmds is provided cmd is ignored
hostname String - The DNS name of a Jenkins instance to connect to (used when ssh is enabled)
User property is: jenkins.hostname.
majorVersion String - This is the "major version" for the project. For a project with the version "1.1.0" the major version is "1.1". If not provided, this value is filled in automatically based on information from the POM.
User property is: jenkins.majorVersion.
scmType String - This is the type of SCM for the project eg "svn" or "git". If not provided, this value is filled in automatically based on information in the POM.
User property is: jenkins.scmType.
scmUrl String - This is the SCM url for the project eg "http://svn.kuali.org/repos/foundation/trunk/jenkins-maven-plugin". If not provided, this value is filled in automatically based on information in the POM.
User property is: jenkins.scmUrl.
sshEnabled boolean - If true, Maven will issue Jenkins CLI commands over ssh instead of via java -jar jenkins-cli.jar
Default value is: true.
User property is: jenkins.sshEnabled.
sshPort int - For ssh enabled calls, this is the port the Jenkins server has been configured to listen on for SSH connections.
Default value is: 45358.
User property is: jenkins.sshPort.
sshVerbose boolean - If true, ssh is executed with -v. Useful for troubleshooting ssh issues
Default value is: false.
User property is: jenkins.sshVerbose.
stdin String - Anything supplied here is provided as input to the standard input stream of Jenkins CLI
User property is: jenkins.stdin.
stdinUrl String - This can be a file on the file system, a classpath resource using Spring's "classpath:" notation, or any other url Spring 3.0 resource loading can understand. If supplied, the content of the url is provided as input to the standard input stream of Jenkins CLI. If stdinUrl is supplied stdin is ignored.
User property is: jenkins.stdinUrl.
styles List - Optional List of custom Style xml templates. Custom style templates are supplied to the plugin like this:
<configuration>
  <styles>
    <style>
      <name>my-custom-style</name>
      <template>classpath:org/foo/bar/my-custom-style.xml</template>
    </style>
  </styles>
</configuration>

User property is: jenkins.styles.
url String - The fully qualified url of a Jenkins instance to connect to. This is required if sshEnabled is false.
Default value is: ${project.ciManagement.url}.
User property is: jenkins.url.
username String - Username for an account on the Jenkins instance (used when ssh is enabled)
Default value is: ${user.name}.
User property is: jenkins.username.

Parameter Details

cmd:

Jenkins CLI command to issue eg "help", "version", "who-ami-i", "build my-job -c -s" etc
  • Type: java.lang.String
  • Required: Yes
  • User Property: jenkins.cmd
  • Default: version

commands:

List of commands to issue to Jenkins CLI eg "help", "version", "who-ami-i" etc If cmds is provided cmd is ignored
  • Type: java.util.List
  • Required: No

excludeVersion:

If true, the version of the Maven project is not included in the job name
  • Type: boolean
  • Required: Yes
  • User Property: jenkins.excludeVersion
  • Default: true

failOnError:

If true, the Maven build will fail if Jenkins CLI returns a non-zero exit value, otherwise the Maven build will continue
  • Type: boolean
  • Required: Yes
  • User Property: jenkins.failOnError
  • Default: true

hostname:

The DNS name of a Jenkins instance to connect to (used when ssh is enabled)
  • Type: java.lang.String
  • Required: No
  • User Property: jenkins.hostname

jobTypes:

Comma separated list of known job types. When specifying a job name these can be used as shorthand for the fully qualified job name. eg "publish" gets expanded to "jenkins-maven-plugin-publish". To turn off expansion set jobTypes to the empty string, null, or NONE
  • Type: java.lang.String
  • Required: Yes
  • User Property: jenkins.jobTypes
  • Default: publish,unit,license,release

majorVersion:

This is the "major version" for the project. For a project with the version "1.1.0" the major version is "1.1". If not provided, this value is filled in automatically based on information from the POM.
  • Type: java.lang.String
  • Required: No
  • User Property: jenkins.majorVersion

scmType:

This is the type of SCM for the project eg "svn" or "git". If not provided, this value is filled in automatically based on information in the POM.
  • Type: java.lang.String
  • Required: No
  • User Property: jenkins.scmType

scmUrl:

This is the SCM url for the project eg "http://svn.kuali.org/repos/foundation/trunk/jenkins-maven-plugin". If not provided, this value is filled in automatically based on information in the POM.
  • Type: java.lang.String
  • Required: No
  • User Property: jenkins.scmUrl

sshEnabled:

If true, Maven will issue Jenkins CLI commands over ssh instead of via java -jar jenkins-cli.jar
  • Type: boolean
  • Required: No
  • User Property: jenkins.sshEnabled
  • Default: true

sshPort:

For ssh enabled calls, this is the port the Jenkins server has been configured to listen on for SSH connections.
  • Type: int
  • Required: No
  • User Property: jenkins.sshPort
  • Default: 45358

sshVerbose:

If true, ssh is executed with -v. Useful for troubleshooting ssh issues
  • Type: boolean
  • Required: No
  • User Property: jenkins.sshVerbose
  • Default: false

stdin:

Anything supplied here is provided as input to the standard input stream of Jenkins CLI
  • Type: java.lang.String
  • Required: No
  • User Property: jenkins.stdin

stdinUrl:

This can be a file on the file system, a classpath resource using Spring's "classpath:" notation, or any other url Spring 3.0 resource loading can understand. If supplied, the content of the url is provided as input to the standard input stream of Jenkins CLI. If stdinUrl is supplied stdin is ignored.
  • Type: java.lang.String
  • Required: No
  • User Property: jenkins.stdinUrl

stopOnError:

If true, the build will fail the first time Jenkins CLI encounters an issue. When false, mojo's that issue multiple CLI requests, will proceed through their list of requests and then fail at the end if an issue was encountered along the way.
  • Type: boolean
  • Required: Yes
  • User Property: jenkins.stopOnError
  • Default: false

style:

The style of Jenkins job. Default styles are freestyle and maven. This parameter must be one of the default styles or match the name of a custom style supplied to the plugin
  • Type: java.lang.String
  • Required: Yes
  • User Property: jenkins.style
  • Default: freestyle

styles:

Optional List of custom Style xml templates. Custom style templates are supplied to the plugin like this:
<configuration>
  <styles>
    <style>
      <name>my-custom-style</name>
      <template>classpath:org/foo/bar/my-custom-style.xml</template>
    </style>
  </styles>
</configuration>
  • Type: java.util.List
  • Required: No
  • User Property: jenkins.styles

successCodes:

Comma separated list of integers that represent a Jenkins CLI command completing successfully
  • Type: java.lang.String
  • Required: Yes
  • User Property: jenkins.successCodes
  • Default: 0

timestampFormat:

The format for timestamp displays
  • Type: java.lang.String
  • Required: Yes
  • User Property: jenkins.timestampFormat
  • Default: yyyy-MM-dd HH:mm:ss z

url:

The fully qualified url of a Jenkins instance to connect to. This is required if sshEnabled is false.
  • Type: java.lang.String
  • Required: No
  • User Property: jenkins.url
  • Default: ${project.ciManagement.url}

username:

Username for an account on the Jenkins instance (used when ssh is enabled)
  • Type: java.lang.String
  • Required: No
  • User Property: jenkins.username
  • Default: ${user.name}

workingDir:

The working directory for the plugin
  • Type: java.io.File
  • Required: Yes
  • User Property: jenkins.workingDir
  • Default: ${project.build.directory}/jenkins