Skip to content

Enterprise Maven Infrastructure

Introduction

A prerequisite for efficient development is to choose good tools and use these tools to their full potential. The Java community has a comprehensive suite of tools to choose from; IDE, VCS, build tools, CI server and Build Artifact Repository Manager. It is common (perhaps even best practice?) to standardize on VCS and build tool on Enterprise Java projects. While it might be appropriate to standardize on IDE in a small (not Enterprise) project, this is seldom a good idea (reasoning: three competing IDEs, "works-here-syndrome", etc.). As of time of writing Maven2 is the leading build tool on the market and Subversion is the most popular VCS. For repository management, the choice is not that obvious as there are at least three adequate products available; Archiva, Artifactory and Nexus. Archiva has no support for virtual repositories, so Artifactory seems a better choice for most big companies. Nexus claims to have both virtual repository support and use file system storage (not a Java space like Artifactory) and surfs up as an enticing alternative to the two others. The recommendations given is based on experiences from using Artifactory, but most should apply to both Nexus and Archiva. There are plenty of good Continuous Integration servers available, both commercial and Open Source. An overview of some of the most popular ones can be found in Continuous Integration Server Overview. Choose anyone you want. We prefer Continuum for two reasons: 1. It has excellent support for Maven projects and utilize a lot of information from the POM. 2. Projects can be released from the GUI, which makes it easier for system architects, project managers and other non-developers to cut a release. The rest of this article will explain how to work efficiently on Maven-based projects in an Enterprise context, with focus on the infrastructure required. Effective communication is a key component in any well-functional team. This topic is outside the scope of this article, but a wiki, an issue tracker, email lists and an agile mindset are highly recommended. Example setup 1. IDE - any 2. VCS - Subversion 3. Build tool - Maven2 4. Build Artifact Repository Manager - Artifactory 5. Continuous Integration Server - Continuum

Component overview

There are basicly three main processes we want Enterprise Maven Infrastructure to support (in addition to regular Continuous Integration)
1. use CI server to deploy snapshots to the build artifact repository manager
2. release (initiated from CI server or directly with maven)
3. deploy the technical site so the documentation (for the snapshot or the release is easily accessable)

Step 3. is optional, but deploying the site at least nightly AND for every release adds a lot of value.

1. Deploy snapshots --- ---

Implementation recommendations

Administration
  • It is important that the system administrators feel ownership and take responsibility for the infrastructure.

  • Always use service names for all services to make it possible to switch implementations easily. E.g., avoid http://192.168.1.1:8080/artifactory in company parent-pom.

Resources

External articles about Maven infrastructure