Sun, 26 Jun 2011 12:59:10 +0300, /Stanimir Stamenkov/:
I've really included "jboss-seam" as a dependency and I even
expect I don't need to define it as <ejbModule> in the EAR plugin
configuration, as it is already declared as
<packaging>ejb</packaging>, but without defining it as <ejbModule>
it ends up packaged as ordinary lib and not included in the
"application.xml" (this might be related to the main problem).
O.k. I've tried with my own EJB module and I've found I have to
specify <type>ejb</type> for the dependency to get automatically
included as EJB module in the EAR. So the attached "pom.xml"
appears to build as expected.
However I seem to get problem when "jboss-seam" is declared in
<dependencyManagement> in a parent POM. Place the attached
"parent-pom.xml" and "ear-pom.xml" in a same directory (the same
happens using standard layout having the EAR pom.xml in a child
directory) and build using either one of them:
$ mvn -f parent-pom.xml install
or
$ mvn -f ear-pom.xml install
I get:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: net.example.ear:seam-ear
POM Location: ...\ear-pom.xml
Validation Messages:
[0] 'dependencies.dependency.version' is missing for
org.jboss.seam:jboss-seam:ejb
Reason: Failed to validate POM for project net.example.ear:seam-ear at
...\ear-pom.xml
Specifying the "jboss-seam" version additionally in the EAR POM
seems to fix the things, but why one has to do it given the version
is specified in the parent POM?
--
Stanimir
<?xml version="1.0" encoding="UTF-8" ?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.example.ear</groupId>
<artifactId>seam-ear</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>ear</packaging>
<name>seam-ear</name>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>2.6</version>
<configuration>
<version>5</version>
<defaultLibBundleDir>lib</defaultLibBundleDir>
<fileNameMapping>no-version</fileNameMapping>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam</artifactId>
<version>2.0.2.SP1</version>
<type>ejb</type>
</dependency>
</dependencies>
<repositories>
<repository>
<id>public-jboss</id>
<url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
</repository>
</repositories>
</project>
<?xml version="1.0" encoding="UTF-8" ?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.example.ear</groupId>
<artifactId>seam-ear-parent</artifactId>
<version>0.0.2-SNAPSHOT</version>
<packaging>pom</packaging>
<name>seam-ear-parent</name>
<modules>
<module>./ear-pom.xml</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
<ejb.ejbVersion>3.0</ejb.ejbVersion>
<jboss.seamVersion>2.0.2.SP1</jboss.seamVersion>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<version>2.3</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>2.6</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam</artifactId>
<version>${jboss.seamVersion}</version>
<!-- <type>ejb</type> -->
</dependency>
</dependencies>
</dependencyManagement>
<repositories>
<repository>
<id>public-jboss</id>
<url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
</repository>
</repositories>
</project>
<?xml version="1.0" encoding="UTF-8" ?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.example.ear</groupId>
<artifactId>seam-ear-parent</artifactId>
<version>0.0.2-SNAPSHOT</version>
<relativePath>./parent-pom.xml</relativePath>
</parent>
<artifactId>seam-ear</artifactId>
<packaging>ear</packaging>
<name>seam-ear</name>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<version>5</version>
<defaultLibBundleDir>lib</defaultLibBundleDir>
<fileNameMapping>no-version</fileNameMapping>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam</artifactId>
<!-- <version>${jboss.seamVersion}</version> -->
<type>ejb</type>
</dependency>
</dependencies>
</project>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]