开发者

how do I access jacc.jar and jta.jar when using hibernate with maven?

开发者 https://www.devze.com 2023-03-07 00:15 出处:网络
I\'m trying to migrate an existing eclipse web project (wtp) to maven, using m2e. I\'m therefore adding jars one by one to m开发者_如何转开发aven pom.xml (torture)

I'm trying to migrate an existing eclipse web project (wtp) to maven, using m2e. I'm therefore adding jars one by one to m开发者_如何转开发aven pom.xml (torture) when it comes to hibernate, maven automatically downloads some dependencies of hibernate3.jar and it fails due to jacc.jar and jta.jar. There are millions of pages complaining about it, but as of today, with maven 2 and the existing project, what do I need to do? I need to create a maven based deployment package which can access only public repositories.


  • Use the JBoss Maven repository (it's public):

    <repositories>
      <repository>
        <id>jboss-public-repository-group</id>
        <name>JBoss Public Repository Group</name>
        <url>http://repository.jboss.org/nexus/content/groups/public</url>
      </repository>
      ...
    </repositories>
    
  • add the dependency to the pom:

    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-core</artifactId>
      <!-- or hibernate-entitymanager if you use jpa -->
      <version>3.6.4.Final</version>
      <!-- or whichever version you use -->
    </dependency>
    

Voila, that's it


The Guide to Coping with Sun JARs page on the Maven site lists the groupId and artifactId to be used with the official Sun API JARs, which may help you out. It can be pretty confusing as there isn't much of an easy-to-discern pattern to follow, and Sun/Oracle don't publish a standard reference either.

0

精彩评论

暂无评论...
验证码 换一张
取 消