# Spring, Maven, and Nexus Best Practices

**December 02, 2009**  
By [Jason van Zyl](/content/blog/author/jason-van-zyl/index.html)

1 minute read time

Today, [Keith Donald](https://x.com/kdonald) posted [an entry about obtaining Spring 3 artifacts with Maven](https://spring.io/blog/2009/12/02/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 on the best practices 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 and release. I won't go into the details here, but instead refer you to [Brian Fox's blog entry on the matter](/content/blog/2009/02/why-putting-repositories-in-your-poms-is-a-bad-idea/index.html).

The alternative I would suggest is to use a repository manager like [Sonatype Nexus Repository](/content/products/sonatype-nexus-repository/index.html) and proxy the Spring repositories that you are interested in using. I would assume a team might be interested in releases, milestones, and snapshot repositories. So at Nexus OSS (now known as [Sonatype Nexus Repository Community Edition](/content/products/nexus-community-edition-download/index.html)) I setup the three Spring repositories as you see below.

You 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 most Spring users are Maven users, so I hope this helps get their Maven-based environments set up in a best-practices fashion.

Written by **Jason van Zyl**  
Jason is a co-founder and the former CTO of Sonatype.

Tags

Sonatype Says Everything Open Source Nexus Repo Reel
