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:
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.
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.
- Organizing Maven projects
- Repository Management
- CI recommendations
- Version Control System tips and tricks
- Technical site and reporting
- Automatic code review
- Agile Project Communication
- 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.
- Integrated Development Environment (IDE) (IntelliJ IDEA, Eclipse, Netbeans)
- Version Control Management System (VCS) aka. Source Control Management (SCM)
- Build tools: Maven2, Maven1, Ant, make, gradle
- Build Artifact Repository Manager