Import the javax.persistence and javax.inject libraries

1

How do I import the javax.persistence and javax.inject libraries into a maven project?

Note: I'm using eclipse.

    
asked by anonymous 13.07.2015 / 17:56

1 answer

2

All dependencies of these two groupID are in the central repositories, so in short, just include the libraries you need in your pom.xml .

In the case of groupId javax.inject are just two, an example would be this:

<dependency>
    <groupId>javax.inject</groupId>
    <artifactId>javax.inject</artifactId>
    <version>1</version>
</dependency>

Since dependencies with groupId javax.persistence are more, an example would be the persistence API:

<dependency>
    <groupId>javax.persistence</groupId>
    <artifactId>persistence-api</artifactId>
    <version>1.0.2</version>
</dependency>

To include directly through Eclipse, right click on the maven project, Maven > Add Dependency , as in the image below:

Inthedialogthatwillbedisplayed,simplyincludetherequestedinformation,orsearchforthesegroupIdyouneed,asintheexamplebelow:

If you need some other dependency, you can in an indexer such as MVNRepository

    
13.07.2015 / 19:13