Dynamically Disable Deployment of Artifacts and Build-info

JFrog Integrations Documentation

ft:sourceType
Paligo

Maven, Gradle and Ivy builds can be configured to deploy artifacts and/or build information to Artifactory. For example, in the case of Gradle builds, you would set the Publishing repository field and check Capture and publish build-info. Maven and Ivy have similar (although slightly different) configuration parameters. By setting these parameters, you can configure each build tool respectively to deploy build artifacts and/or build information to Artifactory. However, there may be specific cases in which you want to override this setting and disable deploying artifacts and build information. In these cases, you can pass the following two system properties to any of the build tools:

  • artifactory.publish.artifacts

  • artifactory.publish.buildInfo

    For example, for a Maven build, you can add these system properties to the Goals and options field as follows:

clean install -Dartifactory.publish.artifacts=false -Dartifactory.publish.buildInfo=false

To control these properties dynamically, you can replace the values with Jenkins variables or Environment variables that you define as follows

clean install -Dartifactory.publish.artifacts=$PUBLISH_ARTIFACTS -Dartifactory.publish.buildInfo=$PUBLISH_BUILDINFO