I use Maven, Tomcat Java EE and I want to add a dependency for this import :
import javax.persistence.Entity
I’ve tried these but they do not work:
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0.2</version>
</dependency>
and this:
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
Why you use JPA 1 with Java EE 6? Java EE 6 already contains JPA 2 and this
javaee-apiartifact provides that classes. It can not work, whatever you mean exactly by not working here. Get rid of this JPA 1 dependency and try again.