Today Keith posted an entry about obtaining Spring 3 artifacts with Maven using the method of sourcing Maven repositories from inside POMs. I wanted to suggest an alternative for Spring users which draws upon best practices that we’ve developed over time with our enterprise clients doing large builds with a healthy number of developers on the team. Putting repositories in POMs generally looked dimly upon and I consider it an anti-pattern for enterprise build & release. I won’t go into the details here but instead refer you to Brian Fox’s blog entry on the matter.
The alternative I would suggest is use a repository manager like Nexus and proxy the Spring repositories that you are interested in using. I would assume that at some point in time a team might be interested in releases, milestones and snaphot repositories. So at Nexus OSS I setup the three Spring repositories as you see below:
You then might want to use a single URL in your Maven settings to represent the set of Spring repositories as you can see below:
Most organizations though end up having a single URL for developers where all the repositories you might use are managed in a single location. Sonatype has some documentation in the Nexus book for configuring your developers to use a single group. This is usually the way large organizations manage their developers when working with Maven, but I just wanted to show how easy it is to create proxies and manage them together in groups with Nexus.
I know that the vast majority of Spring users are Maven users so I hope this helps get their Maven-based environments setup in a best-practices fashion.