This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Private plugin repository for Maven project.

 
Gaurav Upadhyay
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings.

i need some insight on how Maven supports setup of private plugin repositories. Having internal private repositories (on nexus/artifactory) helps hosting third party jars and project snapshot jars. However, each developer in the project needs to download the maven plugins from the Maven central repository(like maven-compiler-plugin, maven-jar-plugin etc).

Is is possible to have all these plugins available in the internal private repository (on nexus/artifactory) so that the users can simply get them via the internal repo and can even work offline, while the internal repo is made to have all the plugins along with the artifacts that they need for their work?

Thanks
Gary
 
Jayesh A Lalwani
Rancher
Posts: 2756
32
Eclipse IDE Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Both Nexus and Artifactory can be configured to work as mirrors of central repositories. Indeed, the people who host the central repositories even encourage you to setup mirrors, so you don;t overload them.

The way you do this is
a) Setup Nexus/Artifactory internally to mirror central Maven/Jboss/any 3rd party repo
b) Setup your pom.xml to only look at your internal repo

When you run a build, maven will look up your local repo (the one that resides ON the node that is running the build). If it doesn't find it in local repo, it looks up your internal repo. The internal repo looks up in it's own local repo. If internal repo doesn't find it, it looks up the central repo that it mirrors. Internal repo downloads the artifact, puts it in it's own local repo and returns it to the caller. Maven takes it and puts it in the local repo.

Next time the same node does the build, maven will get it from the local repo on the node. Once the node has downloaded all artifacts, it can work offline. If some other node does the same build, the interbnal repo will serve up the artifact from it's local repo and avoid the call to the central repo.

I've done this in Artifactory, and it works beautifully. Another advantage is that Artifactory creates a seperate cache for every central repo that it caches. Once in a while I go there and look through it to see if all the artifacts are coming from the correct sources.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have done the same with Nexus, so all of the benefits Jayesh mentions for Artifactory apply to it also. I wouldn't work in a Maven environment without such a repository manager!
 
Gaurav Upadhyay
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the reply.

In my case, unfortunately things are a little more complicated. Given a setup where the intended internal mirror's host box does not have internet connectivity, whereas the nodes do; is there a way to update the mirror host either manually or via furnishing it's local repository?
 
Jayesh A Lalwani
Rancher
Posts: 2756
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm spotty connections on internal repo will be problematic since you don't want to complete mirror the whole central repo. If you ask the Maven folks nicely they can help you setup your repo as a complete mirror. However, it;s going to cost you a lot in terms of space

You can add artifacts manually to Artifactory, but you will be spending a lot of time adding artifacts. Remember you need to add depdnencies, and dependencies of dependencies, and dependencies of dependencies of dependencies.. and so on

I have to say your setup is wierd. WHat's the reason behind the internal repo not having connectivity? Security? If your nodes have access to the internet, why not just setup the internal repo on a node?


 
Gaurav Upadhyay
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am in 100% agreement with you, my setup really is weird. The reason is mostly red tapes and unflexible org structures.

however, thanks for your inputs .

thanks
_G
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic