I have a small problem with some dependency.
First a word about my environment :
Maven with the M2Eclipse plugin
My project is made of 1 parent project and 2 other projects (modules).
First i had a problem with the ojdbc14 library. It was complaining that it could not find the ojdbc14.jar :
So I fixed it with the following command :
mvn install:install-file -Dfile=D:\Dev\oracle\oracleexpress\app\oracle\product\10.2.0\server\jdbc\lib\ojdbc14.jar -Dpackaging=jar
-DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.1.0
I added it to the local repository.
But then i get another error when i run "mvn install" from Eclipse, using the M2eclipse plugin :
[ERROR] Failed to execute goal on project projet.core: Could not resolve dependencies for project
fr.celinio.gwt:projet.core:jar:0.0.1-SNAPSHOT: Could not find artifact javax.transaction:jta:jar:1.0.1B in central (http://repo1.maven.org/maven2) -> [Help 1]
So I installed the jta:jar in my local repository, like i did for the ojdbc.jar library :
mvn install:install-file -DgroupId=javax.transaction -DartifactId=jta -Dversion=1.0.1B -Dpackaging=jar -Dfile=D:\Temp\jta-1_1-classes.jar
But why does it keep looking into the central repository (http://repo1.maven.org/maven2) ?
Shouldn't Maven look first in the local repository, find the library and then skip looking in the central repository ?
Here is the pom.xml of my parent project :
Here is the pom.xml of the projet.core module (the project with the ojdbc14.jar dependency) :
And here is the pom.xml of the other module :
Another thing :
1) C:\Users\userbob\.m2\ does not have a settings.xml file.
2) Rebuilding the index of the local repository in Eclipse (Repositories view) did not change anything
I fixed my problem by adding the following repository in the project.core/pom.xml file :
However, I would like to know / understand why installing the indirectly referenced jta-1.0.1B.jar library in my local repository did not work. It keeps looking in the global repository.
Isn't Maven supposed to first check the libraries that are available in the local repository and then eventually check the global repository (or any other repository) ?
I am wondering if Eclipse is using an older/different version of your settings.xml file and is thus lokking at a different location for your local repository. So when you ran mvn from the command line to install jta it went into one local repository, but when you ran mvn from eclipse it used another location? It happened to me!