Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Writing Maven Dependency for javax.persistence

Tags:

Can someone help me write the dependency for javax.persistence. I have googled it but nothing worked.

I bumped into this page that gives some details on how to write the dependency, but yet i am unable to write it. Can someone help me out?

like image 470
Illep Avatar asked Nov 23 '11 13:11

Illep


1 Answers

This is the one for javax.persistence:

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

and this is for the whole Java EE 6 stack:

<dependency>    <groupId>javax</groupId>    <artifactId>javaee-api</artifactId>    <version>6.0</version>    <scope>provided</scope> </dependency> 

Edit
Note that I specified a provided scope here, which means that your dependency is available at compile- and test-time, but will not be packaged into your artifacts. This is usually needed if you want to deploy your artifacts in an application server, since they provide their own implementation of the api.

like image 187
LeChe Avatar answered Sep 24 '22 07:09

LeChe