I am new to maven, and I am having trouble getting it to resolve some dependencies in a pom.xml file that I inherited. Rather than try to tackle all the failed dependencies, I decided to try and resolve just one. I took the original pom.xml and cut out everything except one dependency that was failing.
I know the jar file is in my local repository, but I keep getting an error message from maven that it cannot be found.
Here is my .m2/setttings.xml file. Offline is 'true' because I want to force maven to find the dependency in my local repository.
Here is my pom.xml file:
Here is the physical location of the jboss-jsf-api_2.1_spec artifact:
Here is my attempt to re-add the jar (got an error that it was already in the repository):
mvn install:install-file -Dfile=/Users/admin/.m2/repository/org/jboss/javax/faces/jboss-jsf-api_2.1_spec/2.0.1.Final/jboss-jsf-api_2.1_spec-2.0.1.Final.jar -DgroupId=org.jboss.javax.faces -DartifactId=jboss-jsf-api_2.1_spec -Dversion=2.0.1.Final -Dpackaging=jar
By the way, when I set offline to 'false' in settings.xml, I get this error message:
Could not find artifact org.jboss.javax.faces:jboss-jsf-api_2.1_spec:jar:2.0.1.Final in central (http://repo.maven.apache.org/maven2) -> [Help 1]
Here is what I get if I take maven offline by setting offline to 'true' in settings.xml:
1) Check the permissions on your repository? Does your user id have read access? I know it implies you are an admin, but check anyway
2) Can you run that build without any dependencies? Try running "mvn install" and then check if it worked. Ideally it wrong to your local Maven repo. Although Maven giving a clearer error message of why it can't would be helpful too.
It looks like Maven finds the pom file in the directory that you listed and reads the information out of it and then sees that the groupId noted in that pom doesn't match the directory structure within the local repository and then throws that error. I'm not sure, just guessing.
So you might want to fix that groupId in your dependency first and then have the jar placed in the correct location within your local repo.
The dependency information was not correct. That seems to have been the problem. Thanks very much for catching that.
The odd thing is that this worked with a build I was doing using a group repository that had been set up for me.
I didn't start having problems until I tried to update hibernate-core to version 4.3.
Perhaps this triggered Maven to try and look for the file, when it had not been doing so previously?
At any rate, thanks again. Here is the revised pom.xml file:
If you settle for what they are giving you, you deserve what you get. Fight for this tiny ad!