Pages

Monday, November 25, 2013

How to troubleshoot "Missing artifacts" issues in Maven

Check whether the artifacts given in the pom.xml file matches with the artifacts installed in the local repository (.m2/repositories).

I encountered this error once due to last update date appending to the artifact name as given below:

org.apache.stanbol.enhancer.servicesapi-0.11.0-20131021.093418-197.jar
org.apache.stanbol.enhancer.servicesapi-0.11.0-20131021.093418-197.jar.sha1
org.apache.stanbol.enhancer.servicesapi-0.11.0-20131021.093418-197.pom
org.apache.stanbol.enhancer.servicesapi-0.11.0-20131021.093418-197.pom.sha1
org.apache.stanbol.enhancer.servicesapi-0.11.0-SNAPSHOT.jar
org.apache.stanbol.enhancer.servicesapi-0.11.0-SNAPSHOT.pom

Where as pom.xml expected a different set of dependancies as given below:

   
      org.apache.stanbol
      org.apache.stanbol.enhancer.servicesapi
      0.11.0-SNAPSHOT
   


To resolve the issue, delete all the files in the local repository for the .jar file in question using following command.
rm /*

Then install the artifacts again using the goal clean install.
E.g, in Eclipse right click on the project > Run as > Maven build... > Goal "clean install" > Run

No comments:

Post a Comment