0

We have recently decided to use Maven as build system. I'm responsible to migrate all the projects from Ant to Maven. We also decided to use Apache Archiva to configure an internal repository in the company.

I see that Archiva create two repositories by default (internal and snapshots). I also see that it configures the internal repository to proxy the central and java.net repositories. Are there some best practices regarding Archiva configuration?

In the Archiva documentation, there is a possibility to configure Maven to use only the internal repository and then access the remote repository through the internal repository. What do you think about this option?

Thanks for your help

manash
  • 6,985
  • 12
  • 65
  • 125

1 Answers1

2

A Maven repository manager is essential to support Enterprise Maven development. The Maven installer is merely a bootstrap, running Maven for the first time downloads everything it needs from the Maven Central repository in order to compile your project.

The benefits of using a Maven repository aree documented elsewhere but I'll summarize:

  • Efficiency. Repository acts as a cache for Maven Central artifacts
  • Resilience. Repository protects against remote repository failures or lack of internet connection
  • Repeatability. Storing common artifacts centrally, avoids shared build failures caused by developers maintaining their own local repositories.
  • Audit. If all 3rd party libraries used by development come from a single entry point in the build process one can assess how often they're used (based on download log files) and what kinds of licensing conditions apply.

To that end I'd encourage you to use the following Archiva features:

PS I use Nexus for my Maven repository management, but the same concepts apply.

Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185
  • First, thanks for your detailed response. I don't understand the point about repeatability. Even when the team uses common Archiva repositories, they also use their local repositories (in their computer), right? Also, I don't understand what are the advantages of using Virtual repositories. And what do you mean about team? Do you have a scenario to illustrate the point? – manash Nov 24 '11 at 19:55
  • 1
    **Maven's local repository** should really be thought of as a cache. Developers installing extra jars into their local repos (for example Oracle jars) is one of the main reasons Maven builds are not portable. Try and run the build on another machine and it will fail :-( **Virtual repositories** (or Repository Groups in Nexus) enable you to group together remote repositories like Maven Central, Springsource and JBoss under a single URL. It is this URL which you configure in the Maven settings.xml file. Perhaps all you need is one virtual repository. I set one up for each project team – Mark O'Connor Nov 24 '11 at 22:17
  • 1
    About the use of Virtual repositories, what do you mean about team? Do you mean development team, QA team, production? or many development team? Could you explain me its use by example? Thanks :) – manash Nov 25 '11 at 08:40