Maven 2: Spring and JTA dependencies
Posted by Lucio Benfante Sat, 26 Nov 2005 15:06:00 GMT
Few weeks ago I started using Maven 2 for one of my development projects. The project is very simple, but it has dependencies with some external libraries, in particular with Spring:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>1.2.6</version>
<scope>runtime</scope>
</dependency>Introducing this dependency I had the following errors:
Downloading: ->
http://repo1.maven.org/maven2/javax/transaction ->
/jta/1.0.1B/jta-1.0.1B.jar
[WARNING] Unable to get resource from repository central ->
(http://repo1.maven.org/maven2)
...
[INFO] Failed to resolve artifact.
required artifacts missing:
javax.transaction:jta:jar:1.0.1BThis happened because Spring has a transitive dependency with the Sun’s JTA classes, but the JTA jar can’t be inserted in the Maven repository because the Sun’s Binary License.
For solving this dependency you have to download the jta-1_0_1B-classes.zip file from the Sun’s site and install it into your local repository using the following command:
mvn install:install-file \
-Dfile=./jta-1_0_1B-classes.zip \
-DgroupId=javax.transaction \
-DartifactId=jta -Dversion=1.0.1B \
-Dpackaging=jarMore general information in these Maven’s mini guides:



Thanks, very useful!
Thanks, very helpful indeed!
Thanks , the problem is solved!
Thank you! Clean & concise, this is exactly what I wanted.
Thanks, was just what I needed to know.
thanks man, you saved me a lot of time
U can also point the maven rep to: http://download.java.net/maven/2/javax/transaction/jta/1.0.1B/
Thanks a lot :) This is the only good explanation of the problem that I saw after long search.
Thank you! You made my day!
Exactly the information I needed, thanks!
Thanks! it is quite helpful
Thanks a lot :p
Gracias!!!
Thanks! It solved my packaging problem!
Thanks dude, this helped
thanks, this solve my problem
gracias, me sirvio mucho , directo y conciso
Henriks hint at the java.net repository was a very welcome addition. Just add it to your repositories element:
<repository> <id>java.net</id> <name>java.net</name> <url>http://download.java.net/maven/2/</url> </repository>N.B. the above approaches of directly injected into your cache or including a different maven server will make our project unportable to other developer workstations as they will have to hack their settings.xml to get things to work. instead you can do the following:
configure maven to include hibernate artifacts but not the dependency to jta. particularly if you are going to deploy to a container that will provide the class itself you will have to do nothing else. use the following syntax:
org.hibernate hibernate-entitymanager ${hibernate.version} javax.transaction jtaif you are actually going to compile against jta then use the geronimo implimentation of the jta library that does not have a liciensing issue.
org.apache.geronimo.specs geronimo-jta_1.0.1B_spec 1.1.1simply go to mvnrepository.com and search for geronimo-jta to find the correct version of the jta spec to include for your project.
happy coding.
that will teach me not to preview! the pom fragments are as follows:
<dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>${hibernate.version}</version> <exclusions> <exclusion> <groupId>javax.transaction</groupId> <artifactId>jta</artifactId> </exclusion> </exclusions> </dependency>and
<dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-jta_1.0.1B_spec</artifactId> <version>1.1.1</version> </dependency>no luck at mvnrepository.com. jar file can be downloaded here: http://mirrors.ibiblio.org/pub/mirrors/maven2/org/apache/geronimo/specs/geronimo-jta_1.1_spec/1.1.1/
Cool! Exactaly what I want.
this what i am looking for
Very well written. Thanks.
And this is still a problem over 4 years later! geez.
Really helpful! Thanks a lot…/G
Thanx, helpful! )))
nicely explained about decreasing the dependancies. thanks. keep on good work.