Using Artifactory 6.x ?
JFrog Artifactory 6.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 managingefficientdeployment 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 forMaven 3,GradleandIvybuilds.Generic Deployment Tasksare available for all builder types.
Before you begin
Please refer to the general information aboutArtifactory's Build Integrationbefore using the Bamboo Artifactory Plug-in.
Source Code Available!
The Bamboo Artifactory Plugin isan open-source project on GitHubwhich you can freely browse and fork.
Download
Plugin Compatibility:
The Bamboo Artifactory Plugin is fully tested for compatibility with the version of Bamboo that is current when the plugin is released. When a new version of Bamboo is released, the Marketplace lists the Bamboo Artifactory Plugin as incompatible, however, since we regularly update the plugin it is likely to maintain compatibility with patch or minor version upgrades of Bamboo. We recommend testing new Bamboo and plugins releases on a staging environment before upgrading the production environment.
Latest
Downloadversion 2.4.1which is compatible with Bamboo 6.2.5 and above.
Upgrading to version 2.x from version 1.x of the plugin requires new installation steps. Please refer toInstalling the Pluginfor more details.
Older
Version | Download link | Compatibility |
2.3.0 | Download | Bamboo 6.2.x |
2.2.0 | Download | Bamboo 6.1.x |
2.1.1 | Download | Bamboo 6.0.x |
2.1.0 | Download | Bamboo 5.14.x |
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
需求
- Artifactory 2.2.5 or later. For best results and optimized communication, we recommend using the latest version of Artifactory.
- Artifactory Prois required for advanced features, such asLicense Controland enhancedBuild 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. FromBamboo Administration | Artifactory Plugin, click on the"Migrate data to v2" button.
3.删除插件版本1.13.0并重启竹子.
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 theBamboo documentation forInstalling 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 forInstalling 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 asServer Capabilities in Bamboo
To define Server Capabilities for builders:
- Under theAdministrationmenu, selectOverviewto view theBamboo administrationpage.
- Then, underBuild ResourcesselectServer Capabilities
- SelectExecutableas theCapability Type
- SelectArtifactory Maven 3,Artifactory GradleorArtifactory Ivy作为类型from theTypeslist.
- Make sure thatPathpoints 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 underAdministration | Plugins | Artifactory Plugin.
Enter the Artifactory server URL in theAdd New Server Configurationfields.
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 theTasksstep 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 theSystem Wide Artifactory Serverscorrectly with the required credentials, then once you select an Artifactory server, the corresponding fields are populated to let you choose aResolution RepositoryandTarget Repository.
Repository list empty?
If theResolution RepositoryorTarget Repositoryfields remain empty, check that you have entered valid credentials when defining the Artifactory servers.
TheTarget Repositoryfield 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 theRun License Checkscheckbox 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 |
TheMaven dependency scopeson 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 theArtifactory Black Duck Code Center integrationto 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 |
TheMaven dependency scopeson 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 that should be downloaded from Artifactory through the creation of File Specs. Read more about File Specshere.
Before version 2.2.0, specifying dependency patterns was possible through Legacy Patterns, which became deprecated in version 2.2.0
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. Specifying artifact patterns to be deployed to Artifactory is done through the creation of File Specs. Read more about File Specshere.
Before version 2.2.0, specifying artifact patterns was possible through Legacy Patterns, which became deprecated in version 2.2.0
Make sure to add the Generic Deploy task as a final step!
Using File Specs
File Spec are specified in JSON format. They are used in theGeneric ResolveandGeneric Deploytasks, to specify the dependencies to be resolved from Artifactory or artifacts to be deployed to it.
You can use File Specs in one of the following ways:
- Manage them in your SCM, and then during the build, have them pulled to the workspace with the other sources. If you choose this option, you should select the "File" option in the "Upload spec source" or "Download spec source" field and specify the relative path to the File Spec in your workspace.
- Save the File Spec JSON as part of the job configuration. If you choose this option, you should select the "Job configuration" option in the "Upload spec source" or "Download spec source" field and specify the File Spec JSON content in your workspace in the "File path" field.
You can read the File Spec schemahere.
Deployment Projects
The Bamboo Artifactory Plugin also supports Bamboo Deployment projects (read more about Deployment projectshere).
- TheArtifactory Downloadtask downloads artifacts from Artifactory. The artifacts to be downloaded are defined usingFile Specs.
- TheArtifactory Deploymenttask collects the build artifacts which are shared by the build plan associated with the deployment task, and uploads them to Artifactory. In addition, artifacts which were downloaded by Artifactory Download task are also available for deployment.
The "Artifacts Download" Task
TheArtifacts Downloadtask must be prior to theArtifactory Deploymenttask in the Deployment job flow.
The Artifacts Directory
We recommend configuring a subdirectory for theArtifacts Downloadtask.
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 providesfull 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, underAdministrationgo toBuild Resources | Global Variables,fill in aKey/Valuepair and clickSave.
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 namedbuildInfoConfig.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://: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 ofartifactory.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. Ifartifactory.task.override.jdk.env.var没有定义,使用价值的JAVA_HOMEBuild 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 toBamboo Artifactory Plugin - Release Management.
Push to Bintray (Deprecated)
Bintray users can publish build artifacts to Bintray by using the Artifactory Bintray integration.
This can be done on thePush to Bintraytab of the Bamboo Artifactory Plugin in one of two ways:
- You can configure your Bintray details in adescriptor filewhich should be added to your list of build artifacts
- You can check theOverride descriptor filecheckbox and specify the details in thePush to Bintray tab UI.
Using a Descriptor File
1. Create a descriptor file namedbintray-info.json
.
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 theOverride descriptor filecheckbox in thePush to Bintraytab.
2. Fill in the fields that are displayed.
Bintray必填字段
For Bintray OSS users, all fields are mandatory.
For Bintray Pro accounts, theLicensesandVCS URLfields are optional .
Maven Central sync with Bintray
When checking the "Maven Central Sync" checkbox in Push to Bintray configuration page your build will be published to Maven Central after it is pushed to Bintray.
Only packages included tojcentercan 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.