Adding JBoss AS 7 modules on Eclipse using Maven o

2019-02-20 02:46发布

问题:

I'm migrating my project to JBoss AS 7, and I've read a little about its modules. My problem is simple (I think), I have no idea how to include this modules during development phase. For example, I use hibernate, and inside Eclipse, with JBoss Tools and JBoss AS 6, I just need to say that the project will use JBoss 7 and all their "jars" are available. But using JBoss 7, hibernate-core isn't available to me. I know I have an option to add the hibernate-core as "provided" on my pom, but there is another way?

回答1:

Take a look at these links:

  • APIs: http://mvnrepository.com/artifact/org.jboss.as/jboss-as-spec-api/7.1.1.Final

  • Artifacts provided by the server: http://mvnrepository.com/artifact/org.jboss.as/jboss-as-api/7.1.0.CR1

  • All other artifacts (I'm not sure which will be the most suitable for you): http://mvnrepository.com/artifact/org.jboss.as



回答2:

I would say adding the hibernate-core as "provided" on your pom and adding

Dependency: org.hibernate

to your META-INF/MANIFEST.MF or

<dependencies>
    <module name="org.hibernate" />
</dependencies>

to jboss-deployment-structure.xml is the way to go. This way you get runtime access to Hibernate bundled with JBoss without including them in your deployment. Just make sure you use the same version of Hibernate that comes with JBoss (Hibernate 4.0.1 for JBoss AS 7.1.1). Also check out the Developer Guide.