I tried to create an EAR project with EJB and WAR, but I have some problems. I am creating a main project in IntelliJ IDEA from Archetype:
<dependency> <groupId>org.codehaus.mojo.archetypes</groupId> <artifactId>ear-javaee6</artifactId> <version>1.5</version> </dependency>
Then I created an EJB module from Archetype:
<dependency> <groupId>org.codehaus.mojo.archetypes</groupId> <artifactId>ejb-javaee6</artifactId> <version>1.5</version> </dependency>
And then I created a second module from Archetype:
<dependency> <groupId>javax.faces</groupId> <artifactId>javax.faces-war-archetype</artifactId> <version>2.2</version> </dependency>
Then I added the dependencies to the main pom.xml:
<dependencies> <dependency> <groupId>QCforCC-main</groupId> <artifactId>QCforCC-ejb</artifactId> <version>1.0-SNAPSHOT</version> <type>ejb</type> </dependency> <dependency> <groupId>QCforCC-main</groupId> <artifactId>QCforCC-war</artifactId> <version>1.0-SNAPSHOT</version> <type>war</type> </dependency> </dependencies>
And then I tried to build a project - using maven clean and instal. But I have an error:
[ERROR] Projects in the reactor contain a circular link: Edge between 'Vertex {label =' QCforCC-main: QCforCC-war: 1.0-SNAPSHOT '}' and 'Vertex {label =' QCforCC-main: QCforCC-ejb: 1.0-SNAPSHOT '}' represents the loop in the graph QCforCC-main: QCforCC-ejb: 1.0-SNAPSHOT โ QCforCC-main: QCforCC-war: 1.0-SNAPSHOT โ QCforCC-main: QCforCC-ejb: 1.0-SNAPSHOT โ [Help 1] [ERROR] [ERROR] To see the complete error stack error, rerun Maven with the -e switch. [ERROR] Restart Maven with the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectCycleException
Process terminated with exit code 1
And in the EAR pom.xml I have:
<modules> <module>QCforCC-ejb</module> <module>QCforCC-war</module> </modules> <packaging>pom</packaging>
But if I change <packaging>pom</packaging> to <packaging>ear</packaging> IDEA shows an error in the popup:
There were some problems processing the POM: [WARNING] 'build.plugins.plugin. (groupId: artifactId) 'must be unique, but a duplicate plugin declaration was found org.apache.maven.plugins: maven-ear-plugin @ line 41, column 21 [ERROR] "packaging" with the value "ear" is invalid. Aggregator designs require "pom" as packaging. @ row 12, column 16