Maven ignores the provided area

I have an EAR with several EJB dependencies. 2 of them have a predetermined volume dependence for a can integrated in the glass phase. However, when I install mvn on my local computer or when the application is created via maven on hudson, the ear always contains a jar with built-in glass.

eg. DataAccess-ejb with dependency provided

<dependency> <groupId>org.glassfish.extras</groupId> <artifactId>glassfish-embedded-all</artifactId> <version>3.0</version> <scope>provided</scope> </dependency> 

Ejb addiction ear application

 <dependency> <groupId>com.xxx.yyy</groupId> <artifactId>DataAccess-ejb</artifactId> <version>1.0-SNAPSHOT</version> <type>ejb</type> </dependency> 

Any ideas what I am doing wrong or possible suggestions?

Greetings

James

+4
source share
2 answers

Try using mvn dependency:tree to analyze that the artifact includes glassfish-embedded-all.jar , most likely you are missing something. Maven will not include an artifact that is not declared as a direct dependency and / or inherited through a transitive dependency.

You can also specify the mvn dependency:analyze-only command to further clean up those dependencies that you really don't need.

+4
source

Dependencies with the scope provided are not transitive , so you are not getting it transitively, there must be something else. Run mvn dependency:tree from the ear module.

But actually, I'm really curious why you are using the provided scope, I think the test scope might be more appropriate. And by the way, I suggest using GF 3.0.1:

 <dependency> <groupId>org.glassfish.extras</groupId> <artifactId>glassfish-embedded-all</artifactId> <version>3.0.1</version> <scope>test</scope> </dependency> 
+2
source

All Articles