File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes [Maven] Could not find artifact javax.transaction:jta:jar:1.0.1B in central http://repo1.maven.org/ Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "[Maven] Could not find artifact javax.transaction:jta:jar:1.0.1B in central http://repo1.maven.org/" Watch "[Maven] Could not find artifact javax.transaction:jta:jar:1.0.1B in central http://repo1.maven.org/" New topic
Author

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

Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 547

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.oraclejdbc14: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.


SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCBCD 5
Visit my blog
Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 547

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.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5842
    
    7

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!


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [Maven] Could not find artifact javax.transaction:jta:jar:1.0.1B in central http://repo1.maven.org/