Libraries provided by JBoss in Maven-driven Java EE Application

This is actually unlikely for me, but it seems that there is no direct answer on the network about importing JBoss-dependent dependencies into a Maven application driven by Java EE that will be deployed inside it.

AFAIK there are two things related to the problem, that is, the jboss-as-client artifact for external (in the JVM sense) JBoss clients and the jboss-as-component-matrix artifact with a huge <dependencyManagement> block that determines the version of the libraries that JBoss uses. The last artifact is very useful, since I can use the Maven import area to properly configure the entire version. One that is missing (AFAIK), something like jboss-as-client , but for a deployed Java EE application. Something that I can depend on the scope provided and have all the things in the class path, including platform-related APIs (like EJB or JMS) and AS-specific things (like EJB-ext or jboss-messaging ) and, perhaps some other material from lib , lib/endorsed and (mainly) common/lib directories. I know that probably a more efficient practice (and compatible with religion) would be explicit with the dependencies used in the modules, but the method I am asking for is much more pragmatic for me (sorry), at least for Java applications EEs that really use many standard APIs.

I am very curious how you deal with this challenge. I am using 5.1.0.GA version of AS.

+3
source share
2 answers

You must provide your own maven project (infrastructure), which simply packs all the specified dependencies, and all your JBoss projects depend on this infrastructure project with the scope provided .

But shouldn't you only compile against specification jars instead of a concrete implementation?
how

 <dependency> <groupId>org.jboss.spec</groupId> <artifactId>jboss-javaee-6.0</artifactId> <version>1.0.0.Final</version> <type>pom</type> <scope>provided</scope> </dependency> 

Go to the first entry of the โ€œJava EE 6 APIโ€ at http://arquillian.org/guides/getting_started/ .

+4
source

You won't like this answer, but since the libraries are provided at JBoss runtime, other than using the provided scope, that is none of your business. Classes of any non-stationary transitive dependency will be loaded by another class loader (presumably) and live well with application classes.

For not-so-good related classes, what @MichalKalinowski said is true.

0
source

All Articles