• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

[Maven] Could not find artifact javax.transaction:jta:jar:1.0.1B in central http://repo1.maven.org/

 
Ranch Hand
Posts: 563
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a small problem with some dependency.
First a word about my environment :
Eclipse Helios
Maven with the M2Eclipse plugin
Maven 3.0.2
jdk 1.6
Windows 7

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 :
com.oracle:ojdbc14:jar:10.2.0.1.0

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


Thanks for helping.
 
Celinio Fernandes
Ranch Hand
Posts: 563
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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) ?

Thanks.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic