Announcement Announcement Module
Collapse
No announcement yet.
javax.persistence jar missing Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • javax.persistence jar missing

    Below is my pom.xml and within it I have spring-orm (3.0.2.RELEASE) as a dependency. I thought that as a result of having spring-orm as a dependency, javax.persistence would automatically be downloaded to my local m2 respository. Anyone know why this DIDN'T happen? And how I can cause maven to automatically download javax.persistence with the other transient dependencies?

    Code:
    <project>
            <!-- Spring Framework Dependencies -->
    	<dependency>
    		<groupId>org.springframework</groupId>
    		<artifactId>spring-core</artifactId>
    		<version>${spring.version}</version>
    	</dependency>
    	<dependency>
    		<groupId>org.springframework</groupId>
    		<artifactId>spring-orm</artifactId>
    		<version>${spring.version}</version>
    	</dependency>
      </dependencies>
    </project>

  • #2
    Hi

    In fact there is dependency on javax.persistence, but it's optional:
    Code:
    		<dependency>
    			<groupId>javax.persistence</groupId>
    			<artifactId>persistence-api</artifactId>
    			<version>1.0</version>
    			<optional>true</optional>
    		</dependency>
    The reason is that you can use spring-orm with e.g. plain Hibernate or iBatis - in such case you really do not depend on JPA.

    Just add this dependency to your POM with a dependency to JPA implementation of your choice (e.g. Hibernate).

    regards
    Grzegorz Grzybek

    Comment

    Working...
    X