The Maven Artifactory Plugin will need to know your Artifactory credentials to be able to publish your Maven builds to repositories. You can provide this information in the Maven project's
pom.xml configuration file, in the publisher block along with the names of the repositories where artifacts are to be published.
To keep this credential information secure, your
pom.xml should reference these values as system properties that you have defined in your Maven project's
settings.xml configuration file.
For even greater security, you should declare those properties in
settings.xml using the environment variables provided by the Artifactory Integration to the step's execution environment. This also makes your Maven project adaptable to Pipelines – you can change which Artifactory instance is used in your pipeline without having to change your Maven project.
For example, this
settings.xml file references the credentials and URL stored in the
Note that the
MyArtifactory integration must have been specified in the step's
integrations tag (required for the MvnBuild native step) for these environment variables to be available to the step's execution environment.
Once defined in
settings.xml, these properties can then be referenced in the
pom.xml configuration file: