Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add javax.* dependencies in Maven?

Tags:

I am getting tired of manually installing javax jar files in Maven and would like to know what is the best solution to include a dependency on javax.cache, javax.transaction, or other JSRs that are not easy to find in Maven repositories.

like image 691
pjesi Avatar asked Jun 25 '09 16:06

pjesi


People also ask

How do I add a dependency in Maven?

Add a Java Maven Dependency to the Utility ProjectRight-click the utility project, and select Maven>Add Dependency. Type a dependency name in the Enter groupID… field (e.g., commons-logging) to search for a dependency. Select the dependency, and click OK.

What is javax dependency?

inject maven dependency. Maven Dependency. This package or jar specifies a means for obtaining objects in such a way as to maximize reusability, testability, and maintainability compared to traditional approaches such as constructors, factories, and service locators (e.g., JNDI).


2 Answers

Have you seen https://people.apache.org/~ltheussl/maven-stage-site/guides/mini/guide-coping-with-sun-jars.html ?

This link suggests groupID and artifactID's to use, as well as a java.net repository.

It looks to me like almost all of these exist in the central Maven repository under this naming scheme.

like image 178
matt b Avatar answered Sep 20 '22 10:09

matt b


I'm not aware of one, but adding the java.net repository may help you with some of these dependencies:

<repositories>    <repository>       <id>java.net repository</id>       <url>http://download.java.net/maven/2</url>    </repository> </repositories> 
like image 41
Jon Avatar answered Sep 17 '22 10:09

Jon