Using Artifactory 5.x ?
JFrog Artifactory 5.x User Guide
Have a question? Want to report an issue? Contact JFrog support
Overview
Artifactory provides tight integration with Bamboo through the Bamboo Artifactory Plug-in. Beyond managing efficient deployment of your artifacts to Artifactory, the plug-in lets you capture information about artifacts deployed, dependencies resolved, environment data associated with the Bamboo build runs and more, that effectively facilitates fully traceable builds.
Build Runner Support
The Bamboo Artifactory Plug-in currently provides full support for Maven 3, Gradle and Ivy builds. Generic Deployment Tasks are available for all builder types.
Before you begin
Please refer to the general information about Artifactory's Build Integration before using the Bamboo Artifactory Plug-in.
Source Code Available!
The Bamboo Artifactory Plugin is an open-source project on GitHub which you can freely browse and fork.
Download
Latest:
Download version 2.0.1 which is compatible with Bamboo 5.14.x.
Upgrading to version 2.x from version 1.x of the plugin requires new installation steps. Please refer to Installing the Plugin for more details.
Older:
Version | Download link | Compatibility |
1.13.0 | Download | Bamboo 5.14.x |
1.11.2 | Download | Bamboo 5.13.x |
1.11.1 | Download | Bamboo 5.12.x |
1.10.3 | Download | Bamboo 5.11.x |
1.10.1 | Download | Bamboo 5.10.x |
1.9.2 | Download | Bamboo 5.9.x |
1.7.7 | Download | Bamboo 5.8.x |
Installing the Plugin
Requirements
- Artifactory 2.2.5 or later. For best results and optimized communication, we recommend using the latest version of Artifactory.
- Artifactory Pro is required for advanced features, such as License Control and enhanced Build Integration.
- Maven 3.
- Gradle 0.9 or later.
- Ant and Ivy 2.1.0 or later.
Upgrading to Versions 2.x from Versions 1.x
If you are currently using a version of the plugin below 2.0.0 and would like to upgrade to version 2.0.0 or above, you need to migrate your Artifactory configuration data to the format expected by the type 2 plugin as described in the following steps:
1. If you are not already on version 1.13.0 of the plugin, upgrade to that version first.
2. From Bamboo Administration | Artifactory Plugin, click on the "Migrate data to v2" button.
3. Remove plugin version 1.13.0 and restart Bamboo.
4. You're now ready to install version 2.x according to the below instructions.
Installing Versions 2.x
From version 2.0.0, the Bamboo Artifactory Plugin is released as a type 2 plugin. You can read about installing type 2 plugins in the Bamboo documentation for Installing add-ons.
Installing Versions 1.x
Remove older versions
If you have an older version of the plug-in, be sure to remove it before upgrading to a newer one
$BAMBOO_INSTALLATION_HOME/atlassian-bamboo/WEB-INF/lib
folder and restarting Bamboo.For more details please refer to the Bamboo documentation for Installing Plugins type 1 add-ons.
Configuration
To use the Bamboo Artifactory plug-in you need to set up your Artifactory server(s) in Bamboo's server configuration. You can then set up a project builder to deploy artifacts and build-info to a repository on one of the configured Artifactory servers.
Configuring Maven 3, Gradle and Ivy Builders
Before you begin with any Artifactory-specific setup, ensure that Maven 3, Gradle and/or Ivy builders are available for project configurations.
These builders are defined as Server Capabilities in Bamboo
To define Server Capabilities for builders:
- Under the Administration menu, select Overview to view the Bamboo administration page.
- Then, under Build Resources select Server Capabilities
- Select Executable as the Capability Type
- Select Artifactory Maven 3, Artifactory Gradle or Artifactory Ivy as the type from the Types list.
- Make sure that Path points to an installation directory of the selected builder type.
Configuring System-wide Artifactory Server(s)
To make Artifactory servers available to project configurations, they must be defined under Administration | Plugins | Artifactory Plugin.
Enter the Artifactory server URL in the Add New Server Configuration fields.
Username and Password
Username and password are optional and are only used when querying Artifactory's REST API for a list of configured repositories (credentials are only required if the target instance does not allow anonymous access).
Configuring a Project Builder
To set up a project task to deploy build-info and artifacts to Artifactory:
- Go to the Tasks step of your jobs configuration.
- When adding a task type, select the Artifactory Maven 3, Gradle or Ivy builder.
- The builder configuration fields appear and include Artifactory and build-info configuration options.
Selecting Artifactory Servers and Repositories
Select an Artifactory server URL for resolving artifacts and to deploy build artifacts in the corresponding fields.
If you have configured the System Wide Artifactory Servers correctly with the required credentials, then once you select an Artifactory server, the corresponding fields are populated to let you choose a Resolution Repository and Target Repository.
Repository list empty?
If the Resolution Repository or Target Repository fields remain empty, check that you have entered valid credentials when defining the Artifactory servers.
The Target Repository field is populated with a list of available target repositories as returned by the server (queried with the credentials in the server configuration, if provided).
If the repository list remains empty, ensure the specified Artifactory server URL and credentials (if provided) are valid.
Select the target repository you want Bamboo to deploy artifacts and build-info to.
Running Licence Checks
If you have an Artifactory Pro license, you can set the Run License Checks checkbox so that Artifactory will scan all dependencies used by the build to check for any license violations.
This feature offers the following options:
Send License Violation Notifications to | A list of email addresses of users who should receive license violation notifications. |
Limit Checks to the Following Scopes | The Maven dependency scopes on which the license check should be run. If left empty, all scopes will be checked. |
Include Published Artifacts | Indicates that any build artifacts that are dependencies for other build artifacts, should also be scanned for license violations |
Disable Automatic License Discovery | Tells Artifactory not to try and automatically analyze and tag the build's dependencies with license information upon deployment. |
Black Duck Code Center Integration
If you have an Artifactory Pro license, and a Black Duck Code Center account you can use the Artifactory Black Duck Code Center integration to automatically initiate an open source component approval process, and proactively monitor for security vulnerabilities.
This feature offers the following options:
Code Center application name | The name of the Black Duck Code Center application that should be invoked. |
Code Center application version | The Black Duck Code Center application version. |
Send compliance report email to | A list of email addresses of users who should receive license violation notifications. |
Limit checks to the following scopes | The Maven dependency scopes on which the compliance check should be run. If left empty, all scopes will be checked. |
Include Published Artifacts | Indicates that any build artifacts that are dependencies for other build artifacts, should also be scanned for license violations |
Auto create missing component requests | Automatically create missing components in Black Duck Code Center application after the build is completed and deployed in Artifactory. |
Auto discard stale component requests | Automatically discard stale components in Black Duck Code Center application after the build is completed and deployed in Artifactory. |
The Artifactory Generic Resolve Task
The Generic Resolve task can be used in any job with any combination of tasks.
It lets you specify dependency patterns for published artifacts that should be downloaded from Artifactory. You can have detailed control over which artifacts are resolved and downloaded by using query-based resolution, adding a query with the properties that the artifact should have before it can be downloaded, to your artifact paths. FOr more details please refer to Resolution by Properties.
The resolved files will be clustered as dependencies in the Build information.
The Artifactory Generic Deploy Task
The Generic Deploy task can be used in any job with any combination of tasks, and is provided to offer minimal Build Info support for all types.
This task collects all available information regarding the build from Bamboo, and provides a deployment mechanism for the artifacts produced.
Adding the Generic Deploy task automatically deploys Build Info collected from the Published Artifacts declaration in addition to the artifacts themselves.
In addition to specifying the Artifactory Server URL, the Target Repository and the Deployer username and Password, you can specify the following parameters:
The 'Published Artifacts' declaration lets you specify which artifact files produced by the build are published to Artifactory. At build conclusion, the plugin locates artifacts in the build's checkout directory according to the specified artifact patterns and publishes them to Artifactory, optionally applying mapping for the target path of each deployed artifact.
Make sure to add the Generic Deploy task as a final step!
The Artifactory Deployment Task
The Bamboo Artifactory Plugin also supports Bamboo Deployment projects (read more about Deployment projects here).
The Artifactory Deployment task collects the build artifacts which are shared by the build plan associated with the deployment task, and uploads them to Artifactory.
The "Artifacts Download" Task
The Artifacts Download task must be prior to the Artifactory Deployment task in the Deployment job flow.
The Artifacts Directory
We recommend configuring a subdirectory for the Artifacts Download task.
Running a Build
Once you have completed setting up a project builder you can run it. The Artifactory plug-in commences at the end of the build and:
- Deploys all artifacts to the selected target repository in one go (as opposed to the deploy at the end of each module build, used by Maven/Ivy).
- Deploys the Artifactory build-info to the selected server, which provides full traceability of the build in Artifactory, with links back to the build in Bamboo.
You can also link directly to the information in Artifactory from a build run view in Bamboo:
License
The Bamboo Artifactory plug-in is available under the Apache v2 License.
Attaching Searchable Parameters
You can define parameters that should be attached to build info and artifacts that are deployed by the plugin.
To define a parameter, under Administration go to Build Resources | Global Variables, fill in a Key/Value pair and click Save.
The available parameter types are:
buildInfo.property.*
- All properties starting with this prefix will be added to the root properties of the build-info.artifactory.deploy.*
- All properties starting with this prefix will be attached to any produced artifacts that are deployed.
Using a Properties File
Instead of defining properties manually, you can point the plug-in to a properties file.
To do so, define a property named buildInfoConfig.propertiesFile
and set its value to the absolute path of the properties file.
The given path and file should be present on the machine that is running the build agent, not the server.
Overriding Plan values using Bamboo Variables
The Artifactory Plugin supports overriding various in the plan configuration like Deployer credentials, Resolver credentials, repositories etc.
If you wish to override any of the values specified in the table below, you need to configure them as Bamboo variables either through the UI or append then to the REST URL request as a query parameters.
When assigning any value to these Bamboo variables, it will override the job configuration.
curl -ubamboo-user:bamboo-password -XPOST "http://<BAMBOO HOST>:8085/rest/api/latest/queue/MVN-JOB?stage&executeAllStages&bamboo.variable.artifactory.override.deployer.username=new_username&bamboo.variable.artifactory.override.deployer.password=new_password"
In the example above, we use CURL to remotely invoke a Bamboo plan. We set the Deployer username and Deployer password for this specific request.
Note that we add the "bamboo.varaible" prefix to the query parameters.
Note that the sent values will be applied only if the specific task support them. For example: currently Artifactory Gradle tasks do not support Resolver credentials, hence those values will be ignored if sent.
Parameter name | Description | Supported jobs |
---|---|---|
artifactory.override.deployer.username | Deployer username | Maven, Gradle, Ivy, Generic deploy |
artifactory.override.deployer.password | Deployer password | Maven, Gradle, Ivy, Generic deploy |
artifactory.override.resolver.username | Resolver username | Maven, Generic resolve |
artifactory.override.resolver.password | Resolver password | Maven, Generic resolve |
artifactory.override.resolve.repo | Resolve repository | Maven, Gradle |
artifactory.override.deploy.repo | Deploy repository | Maven, Gradle, Ivy, Generic deploy |
artifactory.task.override.jdk | If set to true, check the value of artifactory.task.override.jdk.env.var. If that variable is populated with an environment variable, use the value of that environment variable as the Build JDK path. If artifactory.task.override.jdk.env.var is not defined, use the value of JAVA_HOME for the Build JDK. | Maven, Gradle, Ivy |
artifactory.task.override.jdk.env.var | Stores the name of another environment variable whose value should be used for the build JDK. | Maven, Gradle, Ivy |
Release Management
The Artifactory Plugin provides a powerful feature for release management and promotion. For details please refer to Bamboo Artifactory Plugin - Release Management.
Push to Bintray
Bintray users can publish build artifacts to Bintray by using the Artifactory Bintray integration.
This can be done on the Push to Bintray tab of the Bamboo Artifactory Plugin in one of two ways:
- You can configure your Bintray details in a descriptor file which should be added to your list of build artifacts
- You can check the Override descriptor file checkbox and specify the details in the Push to Bintray tab UI.
Using a Descriptor File
1. Create a descriptor file named bintray-info.json
. You can read about file's structure and see an example under Using the REST API on the Push to Bintray page.
2. Commit the descriptor file to your source control along with your project sources.
3. Modify your build script to attach the file to your build artifacts.
Using the "Push to Bintray" Tab UI
1. Check the Override descriptor file checkbox in the Push to Bintray tab.
2. Fill in the fields that are displayed.
Bintray Required Fields
For Bintray OSS users, all fields are mandatory.
For Bintray Pro accounts, the Licenses and VCS URL fields are optional .
Maven Central sync with Bintray
When checking the "Maven Central synx" checkbox in Push to Bintray configuratoin page your build will be published to Maven Central after it is pushed to Bintray.
Only packages included to jcenter can be synced with Maven Central automatically.
configuration
In order to use Maven Central sync you need to configure your Bintray and Sonatype OSS credentials in Artifactory plugin page like shown in the image below.
Bintray credentials
"Push to Bintray" works with Bintray credentials configured in Artifactory. You only need to specify Bintray credentials if you are using the Maven Central sync option.
Changelog