You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Joel COSTIGLIOLA (Services DPT SYSTEME D INFORMATION METIER)" <jo...@ext.anpe.fr> on 2007/07/13 11:39:27 UTC
[Maven2] Adding transitive dependencies in EAR
Hi,
I'm working on a project (ObjetTrouve) that offers services as EJB packaged in an EAR.
ObjetTrouve structure :
- ObjetTrouveEAR (depends on ObjetTrouveEJB and ObjetTrouveService)
- ObjetTrouveEJB (depends on ObjetTrouveService)
- ObjetTrouveService (depends on third party jar like Spring, log4j, ...)
When buiding the EAR with maven it only packages the direct dependencies i.e. ObjetTrouveEJB and ObjetTrouveService, my application can not work without third party jar needed by ObjetTrouveService.
Questions :
1 - how configure the EAR plugin to include the dependencies of ObjetTrouveService ?
2 - Is there an elegant solution to this problem ?
One solution may be to repeat ObjetTrouveService dependencies in the EAR project pom.xml but it's an ugly solution as I need to duplicate information.
For information here's EAR pom.xml :
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>sapiens</groupId>
<artifactId>ObjetTrouveEAR</artifactId>
<packaging>ear</packaging>
<version>2.6.0</version>
<name>ObjetTrouveEAR</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>sapiens</groupId>
<artifactId>ObjetTrouveEJB</artifactId>
<type>ejb</type>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>sapiens</groupId>
<artifactId>ObjetTrouveService</artifactId>
<type>jar</type>
<version>2.6.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<modules>
<jarModule>
<groupId>sapiens</groupId>
<artifactId>ObjetTrouveService</artifactId>
<includeInApplicationXml>
true
</includeInApplicationXml>
</jarModule>
<ejbModule>
<groupId>sapiens</groupId>
<artifactId>ObjetTrouveEJB</artifactId>
</ejbModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>
</project>
Regards,
Joël Costigliola
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
RE: [Maven2] Adding transitive dependencies in EAR
Posted by "Joel COSTIGLIOLA (Services DPT SYSTEME D INFORMATION METIER)" <jo...@ext.anpe.fr>.
Things works now ! :)
In the EAR project I had forgotten to inherits from parent project.
Joel
-----Message d'origine-----
De : Joel COSTIGLIOLA (Services DPT SYSTEME D INFORMATION METIER) [mailto:joel.costigliola@ext.anpe.fr]
Envoyé : vendredi 13 juillet 2007 11:39
À : Maven Users List; dimuthul@wso2.com
Objet : [Maven2] Adding transitive dependencies in EAR
Hi,
I'm working on a project (ObjetTrouve) that offers services as EJB packaged in an EAR.
ObjetTrouve structure :
- ObjetTrouveEAR (depends on ObjetTrouveEJB and ObjetTrouveService)
- ObjetTrouveEJB (depends on ObjetTrouveService)
- ObjetTrouveService (depends on third party jar like Spring, log4j, ...)
When buiding the EAR with maven it only packages the direct dependencies i.e. ObjetTrouveEJB and ObjetTrouveService, my application can not work without third party jar needed by ObjetTrouveService.
Questions :
1 - how configure the EAR plugin to include the dependencies of ObjetTrouveService ?
2 - Is there an elegant solution to this problem ?
One solution may be to repeat ObjetTrouveService dependencies in the EAR project pom.xml but it's an ugly solution as I need to duplicate information.
For information here's EAR pom.xml :
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>sapiens</groupId>
<artifactId>ObjetTrouveEAR</artifactId>
<packaging>ear</packaging>
<version>2.6.0</version>
<name>ObjetTrouveEAR</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>sapiens</groupId>
<artifactId>ObjetTrouveEJB</artifactId>
<type>ejb</type>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>sapiens</groupId>
<artifactId>ObjetTrouveService</artifactId>
<type>jar</type>
<version>2.6.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<modules>
<jarModule>
<groupId>sapiens</groupId>
<artifactId>ObjetTrouveService</artifactId>
<includeInApplicationXml>
true
</includeInApplicationXml>
</jarModule>
<ejbModule>
<groupId>sapiens</groupId>
<artifactId>ObjetTrouveEJB</artifactId>
</ejbModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>
</project>
Regards,
Joël Costigliola
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org