Usage
The Maven Artifactory Plugin coordinates areorg.jfrog.buildinfo:artifactory-maven-plugin:x.x.x.
It can be viewed onoss.jfrog.org.
A typical build plugin configuration would be as follows:
... org.jfrog.buildinfo artifactory-maven-plugin 3.4.0 false build-info publish awesome qa https://oss.jfrog.org deployer {DESede}... libs-release-local libs-snapshot-local
The plugin's invocation phase isvalidate
by default and we recommend you don't change it so the plugin is called as early as possible in the lifecycle of your Maven build.
配置
The example above configures the Artifactorypublisher, to deploy build artifacts either to thereleasesor thesnapshotsrepository of thepublic OSS instance of Artifactorywhenmvn deploy
is executed.
However, the Maven Artifactory Plugin provides many other configurations which you can see by runningmvn -X validate
and are displayed below:
.. .. .. true/false N .. .. .. .. .. true/false true/false .. .. true/false true/false 10 .. .. .. .. .. .. N N .. ..
Specifiespropertiesyou can attach to published artifacts. For example:
|
|
指定环境变量是否及其作者hed as part ofBuildInfo metadata and which include or exclude patterns are applied when variables are collected |
|
Defines an Artifactory repository where build artifacts should be published using a combination of a Build artifacts are deployed if the |
|
UpdatesBuildInfo metadata published together with build artifacts. You can configure whether or notBuildInfo metadata is published using the configuration. |
Reading Environment Variables and System Properties
每一个构建服务器提供了它自己的set of environment variables. You can utilize these variables when configuring the plugin as shown in the following example:
1 |
|
Any plugin configuration value can contain several{{ .. }}
expressions. Each expression can contain a single or multiple environment variables or system properties to be used.
The expression syntax allows you to provide enough variables to accommodate any build server requirements according to the following rules:
- Each expression can contain several variables, separated by a ' | ' character to be used with a configuration value
- The last value in a list is the default that will be used if none of the previous variables is available as an environment variable or a system property
For example, for the expression{{V1|V2|"defaultValue"}}
the plugin will attempt to locate environment variableV1
, then system propertyV1
, then environment variable or system propertyV2
, and if none of these is available, "defaultValue
" will be used.
If the last value is not a string (as denoted by the quotation marks) and the variable cannot be resolved,null
will be used (for example, for expression{{V1|V2}}
where neitherV1
norV2
can be resolved).
Examples
The following project provides a working example of using the plugin: