<%@ page isELIgnored="true" %> <%@ taglib uri="cms" prefix="cms" %> Dependency Management

Dependency Management

Often, an application will require outside libraries or other files to build: the dependent (parent) project will use the artifacts (e.g., versioned, released binaries) produced by a child project. This guideline is easy to follow if the child's artifacts never, or rarely, change. In this case, you can check the project into source control and manually update the library when you decide to move to a different version. However, the parent project can also rely on the artifacts generated by other projects your organization develops. When this is the case, manually updating dependencies becomes increasingly difficult, and a more robust dependency-management solution is needed.

To address these needs, AnthillPro includes a dependency-management system -- called Codestation -- that provides fine-grained management for your dependencies. Through the AnthillPro UI, you are able to configure and manage dependencies for:

  • Third-party libraries and tools. Most organizations will use externally developed libraries, projects, etc. For example, the parent project may depend on a specific version of the Apache Tomcat server that your organization does not actively develop. AnthillPro provides a special project type -- called Codestation Projects -- to manage these dependency types. A Codestation project is always at the bottom of the dependency tree: it can never depend on another project (i.e., it must always be a child project).

  • Internal projects. Allows for dependency relationships between concurrently developed AnthillPro projects. For example, your application may be composed of numerous components or modules that are independently built. For these types of projects, dependencies are configured in much the same way as with Codestation dependencies. The main difference is that for internal dependencies, the parent project may also be a child project (e.g., project A depends on project B, which in turns depends on project C; however, cycles are not allowed). AnthillPro is configurable to automatically update a parent project with the latest releases of the projects it depends on; lock down the dependency on a specific version (build) of the artifacts; and control whether a dependency should kick off a build or not.

In AnthillPro, dependencies are configured at the workflow level (Codestation projects are a bit different; more on that later), and depend on the artifacts associated with the Build Life of the child project. For example, if your parent project depends on the artifact sets of 2 other project Build Lives, you configure 2 dependencies on the parent's build (originating) workflow -- one for each project (see Configure Dependencies and Using Codestation Projects).

When configuring dependencies, you will need to:

  1. Determine which project your parent project depends on. This information will usually come from your existing dependency-management system or build scripts.

  2. Configure an artifact set on the project your parent project depends on (i.e., the child project). This should include all the files that your parent project needs to successfully build. A publish artifacts step will also need to be added to the child project. See Capture and Deliver Build Artifacts (Child Project).

    If the child project is a Codestation project, see Using Codestation Projects.

  3. Go to your parent project and add a new dependency configuration. You will need to complete the configuration on the Dependencies tab of the originating (build) workflow, as well as add a resolve dependencies step to the build job. See Configure Dependencies.

Once the system is configured, AnthillPro maintains a record of which Build Life the artifacts came from. This provides instant traceability from the parent project back to its own source files, as well as those of each of its dependencies (the children projects).

AnthillPro also allows you to use file-defined dependency configurations. You can use a Codestation method to set the dependencies of a Build Life from a file-defined resolve and then add it to the client and CLI. File-defined dependencies, using an XML file, is supported for both historical resolves and transitive dependencies. Once your file is configured, you can have Codestation pull down the dependencies. For more, go to Tools > Developer Tools > Codestation Client.