Bamboo Artifactory Plug-in

Skip to end of metadata
Go to start of metadata
Table of Contents

Before You Begin

Please make sure to read the general information about Artifactory's Build Integration before going into the Bamboo-specific documentation.

Overview

The Bamboo Artifactory plug-in brings CI Build Integration to Bamboo users. This lets you capture information about deployed artifacts, resolved dependencies and environment data associated with Bamboo build runs and have full traceability for your builds.
In addition, the plug-in also takes care of deploying your artifacts to Artifactory efficiently.

Supported build technologies
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.
Release Management
Version 1.4.0 introduces Release Management capabilities.

Installing the Plug-in

Requirements

  • Artifactory 2.2.5 or later. For best results and optimized communication it is recommended to use the latest version of Artifactory.
    Artifactory Pro is required for advanced features, such as License Control and enhanced Build Integration.
  • Atlassian Bamboo 2.6.0 or later running on JDK 1.6 or later.
  • Maven 3.
  • Gradle 0.9 or later.
  • Ant + Ivy 2.1.0 or later.

Installation

Download the latest version of the plugin:

Configuration

To use the Bamboo Artifactory plug-in you will need to configure your Artifactory server(s) in Bamboo's server configuration. Then you can 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 we begin with any Artifactory-specific setup, we need to make sure that Maven 3, Gradle and/or Ivy builders are available to project configurations. For this, they must be defined as standard build capabilities under Administration->Build Resources->Server Capabilities:
Select "Executable" as the Capability Type, then select "Artifactory Maven 3", "Artifactory Gradle" or "Artifactory Ivy" as the type from the "Types" list. Make sure "Path" points to an installation directory of the selected builder type.

Configuring System-wide Artifactory Server(s)

In order to make Artifactory servers available to project configurations, they must be defined under Administration->Plugins->Artifactory Plugin.
Fill in the Artifactory server URL in the "Add New Server Configuration" form. Username and password are optional and 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's configuration.
When adding a task type, select the Artifactory Maven 3, Gradle or Ivy builder. The builder configuration fields will appear and will include Artifactory and build-info configuration options.

Selecting an Artifactory Server URL. The 'Target Repository' list will be 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, make sure the specified Artifactory server URL and credentials (if provided) are valid.
Select the target repository you wish Bamboo to deploy artifacts and build-info to.

Running License Checks

Use the Artifactory Pro Licene Control feature to discover and handle third party dependency licensing issues as part of the build.
Check the 'Run license checks' option if wish that Artifactory will scan and check the licenses of all dependencies used by this build. If you wish to inform selected users about any license violations detected while scanning, you may enter a white-spaced list of e-mail addresses to the notification recipients text box.

Generic (Freestyle) Deploy tasks

The Generic Deploy task can be used in any job with any combination of tasks; made to provide minimalistic Build Info support for all types, the task collects all the info which is available from Bamboo regarding the build and provides a deployment mechanism for produced artifacts.
Adding the Generic Deploy task will automatically deploy Build Info including artifacts collected from the Published Artifacts declaration.
The 'Published Artifacts' declaration lets you specify which artifact files produced by the build will be published to Artifactory. At the end of the build the plugin will locate artifacts in the build's checkout directory according to the specified artifact patterns and will publish 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!

Attaching Searchable Parameters to Build-Info and Artifacts Deployed by the Plug-in

Under Administration->Build Resources->Global Variables, it is possible to define parameters that will be attached to the build-info and produced artifacts.
To define a parameter fill in the blank parameter row 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 deployed produced artifacts.

It is also possible to point the plug-in to a properties file containing the aforementioned properties.
To point to such a file, define a property named buildInfoConfig.propertiesFile and set its value to the absolute path of the properties file.

Please note that the given path and file should be present on the machine that is running the build agent, not the server.

Running a Build with the Artifactory Plug-in

Once you have completed setting up a project builder you can run it. The Artifactory plug-in will kick in at the end of the build and will:

  1. Deploy 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).
  2. Deploy 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.

Changelog

1.5.1 (05 Jan)

  1. Compatible release plugin for version 3.4.2. (BAP-116)
  2. Support for Gradle properties deployment. (BAP-117)
  3. Unique icon for each Artifactory task type.
  4. Setting Bamboo job requirements correctly for all builder types. (BAP-125)

    1.5.0 (11 Dec)

  1. Compatible with bamboo version 3.3.x.
  2. Compatible with Gradle 1.0-milestone-6.

1.4.2 (19 Sep)

  1. Bug fix (BAP-91)

1.4.1 (01 Aug)

  1. Support for Bamboo 3.2.x
  2. Bug fix (BAP-90)

1.4.0 (14 Jul)

  1. Introducing Release Management capabilities.
  2. Generic Build Info support for all job types.
  3. Bug fixes.

1.3.2 (14 Jun)

  1. Bug fix (BAP-65)

1.3.1 (13 Jun)

  1. Bug fix (BAP-64)

1.3.0 (30 May 2011)

  1. Support for Bamboo 3.1.x

1.2.0 (2 Mar 2011)

  1. Support for Bamboo 3.x

1.1.0 (2 Jan 2011)

  1. Gradle Support - Gradle builds are now fully supported with the new Gradle builder
  2. Ivy builds now support custom Ivy patterns for artifacts and descriptors
  3. Support for Bamboo 2.7.x

1.0.3 (21 Nov 2010)

  1. Add Include/exclude pattern for artifacts deployment
  2. Bug fix (BAP-26)

1.0.2 (7 Nov 2010)

  1. Control for including published artifacts when running license checks
  2. Limiting license checks to scopes
  3. Control for turning off license discovery when running license checks
Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Nov 04, 2010

    Is it a requirement to have bamboo running JDK 1.6 for the plug-in to work? When an ant + ivy builder is executed and bamboo is running in a JDK 1.5 environment the Artifactory plug-in throws the below error:

    2010-11-04 16:33:05,952 INFO [BAM::Agent 3::Agent:pool-6-thread-1] [PrepareBuildTask] Executing build SERVICE-TEST-1
    2010-11-04 16:33:05,959 INFO [BAM::Agent 3::Agent:pool-6-thread-1] [PrepareBuildTask] Running pre-build action: Build Number Stamper
    2010-11-04 16:33:05,968 INFO [BAM::Agent 3::Agent:pool-6-thread-1] [PrepareBuildTask] Running pre-build action: VCS Version Collector
    2010-11-04 16:33:05,972 INFO [BAM::Agent 3::Agent:pool-6-thread-1] [PrepareBuildTask] Running pre-build action: Clover Grails PreBuild Action
    2010-11-04 16:33:05,972 INFO [BAM::Agent 3::Agent:pool-6-thread-1] [DefaultBuildAgent] Running build task: com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask
    2010-11-04 16:33:06,013 INFO [BAM::Agent 3::Agent:pool-6-thread-1] [Command] Isolated Temporary Directory Ant Command Line Decorator is decorating the command line: [-f, build.xml, clean]
    2010-11-04 16:33:06,013 INFO [BAM::Agent 3::Agent:pool-6-thread-1] [Command] Decorated command line is: [-Djava.io.tmpdir=/var/tmp/SERVICE-TEST, -f, build.xml, clean]
    2010-11-04 16:33:06,027 INFO [BAM::Agent 3::Agent:pool-6-thread-1] [AbstractBuilder] Starting to build 'Service-Test - Test'<br /> ... running command line: /usr/local/ant/apache-ant-1.7.1/bin/ant -Djava.io.tmpdir=/var/tmp/SERVICE-TEST -f build.xml clean<br /> ... in : /build/data/SERVICE-TEST/services<br /> ... using java.home: /usr/jdk/instances/jdk1.5.0<br />
    2010-11-04 16:33:06,028 INFO [BAM::Agent 3::Agent:pool-6-thread-1] [Command] Isolated Temporary Directory Ant Command Line Decorator is decorating the command line: [-f, build.xml, clean]
    2010-11-04 16:33:06,028 INFO [BAM::Agent 3::Agent:pool-6-thread-1] [Command] Decorated command line is: [-Djava.io.tmpdir=/var/tmp/SERVICE-TEST, -f, build.xml, clean]
    2010-11-04 16:33:06,029 FATAL [BAM::Agent 3::Agent:pool-6-thread-1] [ExecuteBuildTask] Failed to execute the build 'SERVICE-TEST-1'
    java.lang.NoSuchMethodError: java.util.Arrays.copyOf([Ljava/lang/Object;I)[Ljava/lang/Object;
            at org.jfrog.bamboo.builder.ArtifactoryIvyBuilder.getEnvironmentSetting(ArtifactoryIvyBuilder.java:423)
            at com.atlassian.bamboo.command.Command.executeCommand(Command.java:73)
            at com.atlassian.bamboo.builder.AbstractBuilder.runBuild(AbstractBuilder.java:307)
            at org.jfrog.bamboo.builder.ArtifactoryIvyBuilder.runBuild(ArtifactoryIvyBuilder.java:386)
            at com.atlassian.bamboo.builder.AbstractBuilder.executeBuild(AbstractBuilder.java:272)
            at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:78)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:592)
            at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
            at org.springframework.orm.hibernate.HibernateInterceptor.invoke(HibernateInterceptor.java:117)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
            at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
            at $Proxy210.call(Unknown Source)
            at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:189)
            at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:90)
            at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:102)
            at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$2.run(NamedThreadFactory.java:47)
            at java.lang.Thread.run(Thread.java:595)
    2010-11-04 16:33:06,033 INFO [BAM::Agent 3::Agent:pool-6-thread-1] [DefaultErrorHandler] Recording error: Failed to execute the build 'SERVICE-TEST-1' : SERVICE-TEST : java.util.Arrays.copyOf([Ljava/lang/Object;I)[Ljava/lang/Object;
    

    Running bamboo using 1.6 JDK seemed to solve the issue.

    1. Nov 07, 2010

      Yes, currently you must run Bamboo with 1.6. Is the compatibility with 1.5 crucial for you?

      1. Nov 12, 2010

        Running JDK 1.5 is not crucial, we were able to run Bamboo with JDK 1.6 without issue. It would be great if the plug-in requirements were updated to indicate Bamboo + JDK 1.6 is required.

        Thanks!

  2. Apr 22, 2011

    Is there some way to have bamboo pick up unit tests when using the gradle builder?  When I select the gradle builder, the option to specify a unit test output directory disappears.  Is there some other mechanism for this with the gradle builder?

    1. Apr 25, 2011

      Unfortunately this cannot be done in the current version as there was no real demand for this up until now; if you feel this is required, you may open a feature request for this on our JIRA.

  3. Oct 12, 2011

    Is there a new version planned which supports the new Bamboo 3.3 release?

    thanks!