Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

My mvn build is trying to grab the following file from an online repository.

http://BAD_WEBSITE/repositories/smpsnapshots/org/jboss/aop/jboss-aop/
2.0.0-SNAPSHOT/maven-metadata.xml

However, that URL no longer exists.

I have the maven-metadata.xml file saved locally, but how can I modify my POM file to get the file locally?

Here's where my config file specifies this bad URL to find the file.

SNAPSHOT.pom

     <distributionManagement>    <!-- Declare the release repository to deploy the 
.zip file to -->
         <repository>
           <id>smpreleases</id>
           <name>Releases</name>
           <url>http://BAD_WEBSITE/content/repositories/smpreleases</url>
         </repository>
         <!-- Declare the snapshot repository to deploy the .zip file to -->
         <snapshotRepository>
           <id>smpsnapshots</id>
           <name>Snapshots</name>
           <url>http://BAD_WEBSITE/content/repositories/smpsnapshots</url>
         </snapshotRepository>    
     </distributionManagement>
share|improve this question

1 Answer 1

Any quick fix will just be temporary; you will run into the same problem over & over again, and have a hard time manually managing the situation. The easiest & most robust solution to this issue (and related problems: missing dependencies, down servers, working disconnected) are all easily remedied by simply installing your own local maven repository. (And it really is simple: nexus is IMO the easiest.)

Once this is done (as simple as unzip & start the server), then point all your maven projects to this local server. (It can be on localhost, or another server on your network.) Assuming nexus for the moment, configure it to be a mirror of all the remote repo's you use. It'll cache these artifacts for you, speeding up new builds on new projects and/or new servers. And now you can push (deploy) to this server too, to share your artifacts with your other maven projects. Things can be staged here & tested (e.g,. jenkins/hudson) before deployed to a public repository (if you do that).

Just remember:

  • any non-snapshot artifacts only have one checksum (sha1/md5) and should always be universally unique -- so it doesn't matter if they come from your local mirror or real remote. (Don't generate the same release artifact more than once.)
  • don't put repository info in your pom; put all that in settings.xml : either ~/.m2/settings.xml or run maven with mvn -s path/to/my/settings.xml
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.