Maven 2: Spring and JTA dependencies

Posted by Lucio Benfante Sat, 26 Nov 2005 08: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:


Introducing this dependency I had the following errors:

Downloading: -> ->
[WARNING] Unable to get resource from repository central ->
[INFO] Failed to resolve artifact.

required artifacts missing:

This 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 file from the Sun’s site and install it into your local repository using the following command:

mvn install:install-file \
  -Dfile=./ \
  -DgroupId=javax.transaction \
  -DartifactId=jta -Dversion=1.0.1B \

More general information in these Maven’s mini guides:

Posted in  | Tags , , ,  | 37 comments


  1. Avatar sohallor said 476 days later:

    Thanks, very useful!

  2. Avatar fbregnvig said 557 days later:

    Thanks, very helpful indeed!

  3. Avatar cav said 563 days later:

    Thanks , the problem is solved!

  4. Avatar mike said 622 days later:

    Thank you! Clean & concise, this is exactly what I wanted.

  5. Avatar Sumit said 652 days later:

    Thanks, was just what I needed to know.

  6. Avatar Nick said 657 days later:

    thanks man, you saved me a lot of time

  7. Avatar Henrik said 704 days later:

    U can also point the maven rep to:

  8. Avatar said 758 days later:

    Thanks a lot :) This is the only good explanation of the problem that I saw after long search.

  9. Avatar Retschgi said 759 days later:

    Thank you! You made my day!

  10. Avatar James said 761 days later:

    Exactly the information I needed, thanks!

  11. Avatar Imran M Yousuf said 764 days later:

    Thanks! it is quite helpful

  12. Avatar Olivier said 787 days later:

    Thanks a lot :p

  13. Avatar Nuwi said 800 days later:


  14. Avatar Pierre said 835 days later:

    Thanks! It solved my packaging problem!

  15. Avatar Sunil said 900 days later:

    Thanks dude, this helped

  16. Avatar salvi said 917 days later:

    thanks, this solve my problem

  17. Avatar gerardo said 921 days later:

    gracias, me sirvio mucho , directo y conciso

  18. Avatar Jörn Zaefferer said 958 days later:

    Henriks hint at the repository was a very welcome addition. Just add it to your repositories element:

  19. Avatar simon massey said 997 days later:

    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 jta

    if 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.1

    simply go to and search for geronimo-jta to find the correct version of the jta spec to include for your project.

    happy coding.

  20. Avatar simon massey said 997 days later:
    that will teach me not to preview! the pom fragments are as follows:


  21. Avatar chris_five said 1024 days later:

    no luck at jar file can be downloaded here:

  22. Avatar felipper said 1482 days later:

    Cool! Exactaly what I want.

  23. Avatar kris said 1539 days later:

    this what i am looking for

  24. Avatar Tyler Pedersen said 1544 days later:

    Very well written. Thanks.

  25. Avatar mvnhtr said 1551 days later:

    And this is still a problem over 4 years later! geez.

  26. Avatar Gustaf said 1570 days later:

    Really helpful! Thanks a lot…/G

  27. Avatar Bakhyt said 1587 days later:

    Thanx, helpful! )))

  28. Avatar Dav said 1889 days later:

    Exactly what I needed – and to the point. Thanks.

  29. Avatar benkt said 2010 days later:

    Thank you!

  30. Avatar Brian Lavender said 2014 days later:

    How do you import the JavaDoc?

  31. Avatar Cheap NFL Jerseys said 2053 days later:

    Lost wealth can be replaced by industry, lost knowledge by study, lost health by temperance or medicine, but lost time is gone for ever.

  32. Avatar Philippe C said 2083 days later:

    Thanks ! This was very helpful !

  33. Avatar AKPK said 2158 days later:

    Thanks problem solved

  34. Avatar amal said 2346 days later:

    thaaaaaaaaaaaaaaaanks a lot

  35. Avatar bo huang said 2444 days later:

    thanks a lot!!

  36. Avatar tgyuytse said 2682 days later:


  37. Avatar Mariusz O. said 2744 days later:

    Thank You a lot!!

(leave url/email »)

   Comment Markup Help Preview comment