Who needs the complexity of a Nexus repository, or Ivy when you are already using AnthillPro and it provides a better, less complex and more polished solution for dependency management. AnthillPro already provides the ability for you to define your dependencies in the UI, but most people that are familiar with AnthillPro and have been working with it for years do not know that you can manage all your build-time dependencies through a dependencies.xml file that you keep in your code repository. As a software engineer, this is the ideal solution because it allows me to control my dependencies in a simple xml file and I do not need administrative access to AnthillPro so that I can manage my dependencies via the user interface.

How does it work ?

First, you will need to go into your originating workflow configuration as an admin and check off “Trigger Only Dependencies”

 

Then, you will need to create your xml file and define your dependencies. Anthill projects and Codestation projects are both supported. For those that are not familiar with these 2 concepts, an Anthill project is used for something you “make” where a codestation project is used for something you “store”. Think of this as your project that you’re building as an Anthill project, and the libraries you are using for your project which you download from different places on the internet as codestation projects.

An example xml file would look like this:

<xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.urbancode.com/schema/cs/project-dependencies/1.0"
 name="PROJECT_NAME" workflow="WORKFLOW_NAME">
  <dependencies conflictStrategy="FAIL">
    <!-- Anthill Project Dependencies -->
    <dependency>
      <ah-project name="anthill_dependency_project_name_1" workflow="dependency_workflow_name_1"/>
      <criteria status="success" stamp="*1.1.1.1" />
      <delivery artifact-set="base artifacts">
        <directory>lib</directory>
      </delivery>
    </dependency>
<!-- Codestation dependency example -->
    <dependency>
      <cs-project name="codestation_project_name" />
      <criteria status="success" stamp="codestation_stamp" />
      <delivery artifact-set="base artifacts">
        <directory>lib</directory>
      </delivery>
    </dependency>
 </dependencies>
</project>

Setup this file as you like, and commit it to the base path of your project in your repository.

Then, in your build job, add a shell command after you checkout your code that does:

codestation -file dependencies.xml -buildlife ${bsh:BuildLifeLookup.getCurrent().getId()} resolve

That will create your dependency associations to your buildlife, you can see them in the dependencies tab of the buildlife. Now, when your build runs the step: “Get Dependency Artifacts” the actual files will be fetched into the folder(s) that you’ve defined in your xml.