DoTaL

My repository for development tidbits, and a few personal anecdotes

Setup internal maven repository

Posted by doubleA on February 26, 2007

I have configured a maven proxy for my company so that each developer is not going out and downloading artifacts. This also allows us to have a single company wide repository for our artifacts. The setup steps are not the complicated, but I did run into several issues when I first setup the proxy. Hopefully, this simplifies the process.

  1. Download maven-proxy from codehaus.
  2. Follow the instructions to setup a manual instance.
  3. Modify the default properties file in the maven-proxy directory.. See the attached maven-proxy.doc for a sample. Save this file and change the extension to .properties. You will need to change the name and prefix of your proxy if you don’t like MyRepo.

    maven-proxy properties file

  4. Create a startProxy.bat file instead of manually typing “java -jar….” every time.
    My batch file contains the following line:


    java -jar maven-proxy-standalone-0.2-app.jar maven-proxy.properties

  5. Configure the .bat file from the previous step to startup when the machine starts. I put the bat file in my Startup folder.
  6. Run the startProxy.bat file and verify startup
  7. Configure your dev machine to work with the proxy by editing your settings.xml. See the attached ClientRepoSettings.doc document for a sample of configuring your client machine.

    Maven settings.xml file

  8. Clean out your local .m2 repository
  9. Clean and compile your project to verify that all artifacts are being pulled down from the proxy. You can check the proxy window output to verify that the artifacts are going through the proxy.

4 Responses to “Setup internal maven repository”

  1. ragnar said

    very nice tutorial ;-)

    have you try installing Proximity ? from Abstracthorizon.org

    if so, please email me how to configure (if possible) because I installed it and tried to get it working without modifications but I always have problems (maven2 can not download artifacts)

  2. doubleA said

    ragnar, I have never tried Proximity, but I did take a look at the product site. The product looks a lot cleaner to setup and use than maven-proxy. However, maven-proxy seems to be working for me right now, so I won’t be trying Proximity in the near future. If I were to setup a new dev environment, I would be looking at Proximity.

    Have you had any luck with setting up maven-proxy?

  3. If you want more complete instructions (including creating windows service), look here http://www.jroller.com/page/sjivan?entry=using_maven_proxy_to_setup

  4. Brian Fox said

    Maven Proxy is pretty old now. See here for more information about the new breed of repository managers:
    http://docs.codehaus.org/display/MAVENUSER/Maven+Repository+Manager+Feature+Matrix

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>