Reputation: 1071
I have installed Eclipse, WildFly and Jboss Tools. I created an EAR/Maven project and an EJB/Maven project.
I added all the dependencies to the EAR pom.xml. Jboss Tools deploys the WildFly EAR lib with no issues and the application runs fine.
The problem is the build classpath in the EJB project in Eclipse. As all the dependencies are configured in the EAR pom.xml and not in the EJB pom.xml, I cannot figure out how to tell the EJB project in Eclipse to take from the EAR project the jars that were defined as dependencies.
How to set this up?
Upvotes: 0
Views: 744
Reputation: 35843
You want to "take from the EAR project the jars that were defined as dependencies", but this is not how Maven works.
Jars are drawn from a Maven repository (like MavenCentral or your local repository), according to the dependencies that are defined in the pom. As @N.Shrivastava already said, you define the dependencies in the pom of the project that actually uses the dependencies. So when you have an ear that includes an ejb jar that has some dependencies, put the dependencies into the pom of the ejb jar and delete them from the pom of the ear. They will be transitively drawn into the ear as well.
If you need the same set of dependencies in different ejb jars, this can be realised by creating a separate project of packaging pom. Then the different ejb jars can depend on that pom project, and draw transitively all the dependencies from the pom project.
Upvotes: 0