Import javax.persistence and javax.inject libraries

Asked

Viewed 783 times

1

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

Note: I am using eclipse.

1 answer

2

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

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

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

Already the 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 by Eclipse, right-click on the Maven project, Maven > Add Dependency, as in the image below:

Adicionar dependência

In the dialog that will be displayed, simply include the requested information, or do the search for these groupId that needs, as in the example below:

Detalhes dependência

If you need some other dependency, you can in an indexer like the Mvnrepository

Browser other questions tagged

You are not signed in. Login or sign up in order to post.