Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding missing Maven artifacts

I'm new to Maven, and struggling with adding dependencies. I'm trying to convert an existing project to Maven, and after adding the dependencies for all the jars in my referenced libraries, I'm receiving an error message about missing artifacts:

Missing artifact stax:stax:jar:1.0    
Missing artifact clover:clover:jar:1.3-rc4
Missing artifact log4j:log4j:bundle:1.2.16
Missing artifact stax:stax-ri:jar:1.0

From reading this post: How to handle Maven missing artifact errors?, it sounds like I need to manually download these jars and add them to my local maven repository. My question is how do I find these jars? I tried googling them, and I can find jars that have similar names, but not exactly like these, so I'm not sure if they're the right jars.

Any tips for dealing with this problem? The log4j jar is the only one explicitly listed in the referenced libraries of my original project, so I'm guessing the other ones are required by other jars that I have, and I don't know where to find them or what their exact names should be.

Thanks!

like image 740
matthewb Avatar asked Apr 05 '12 22:04

matthewb


People also ask

What does missing artifact mean?

It means maven is not able to download artifacts from repository. Following steps will help you: Go to repository browser and check if artifact exist.

Where can I find maven repository?

Maven central repository is located on the web. It has been created by the apache maven community itself. The path of central repository is: http://repo1.maven.org/maven2/. The central repository contains a lot of common libraries that can be viewed by this url http://search.maven.org/#browse.


2 Answers

Thanks to everyone for responding. The actual cause of the problem is that for each of those 3 missing artifacts, for some reason, when Maven downloaded them into my local repository, .lastUpdated was appended to the end of the jar. For example, stax-1.0.jar.lastUpdated. This is the reason Maven could not find stax-1.0.jar.

So, to fix this problem, I had to manually download stax-1.0.jar, then install it into the local maven repository in the exact same place as the messed up file, so that Maven could find it. (For example, using the command:

mvn install:install-file -Dfile=<path-to-file>/stax-1.0.jar         
-DgroupId=stax -DartifactId=stax -Dversion=1.0 -Dpackaging=jar

Using the same exact groupId and artifactId as the existing, incorrect file was crucial in order for maven to find it.

like image 83
matthewb Avatar answered Oct 14 '22 02:10

matthewb


You can find dependency search Sites under maven.apache.org. Go to the left side Navigation Menü entry FAQ (official) and Thun to end of page.

like image 44
pein-consulting.de Avatar answered Oct 14 '22 02:10

pein-consulting.de