User guide

  1. Download m2-proxy-version.war from the SF project page
  2. Rename m2-proxy-version.war to m2-proxy.war
  3. Deploy the war to the servlet container
  4. Set Maven mirror setting. Into user.home/.m2/settings.xml insert
      <settings>
      ...
      
      <mirrors>
        <mirror>
          <id>m2-proxy</id>
          <name>Proxy</name>
          <url>http://serveraddress:8080/m2-proxy/resources/</url>
          <mirrorOf>central</mirrorOf>
        </mirror>
    
        <mirror>
          <id>m2-proxy</id>
          <name>Proxy</name>
          <url>http://serveraddress:8080/m2-proxy/resources/</url>
          <mirrorOf>Maven Snapshots</mirrorOf>
        </mirror>
    
      </mirrors>
    
      ...
      
    </settings>
    

    Where serveraddress:8080 is the address of the server and port, where the servlet container is listening on. Do not forget to change the serveraddress to something meaningfull.

  5. (Optional) Change m2-proxy.war/WEB-INF/m2-proxy.properties
    localStore.dir=${user.home}/m2-proxy/repository
    xml.timeout=1d
    pom.timeout=1d
    snapshot.timeout=1d
    default.timeout=never
    
    1. Set localStore.dir to the directory, where the resources should be stored
    2. Optionally you can change timeouts for xml and pom file types. Timeout is a number in miliseconds or something 1d as one day, 3h as 3 hours or 5m as 5 minutes or 10s as ten second. You can also insert "never" for resources that never expires