我创建了JavaEE app EAR = EJB + WAR
项目编译:
[INFO] QCforCC-main ...................................... SUCCESS [0.407s]
[INFO] QCforCC-ejb ....................................... SUCCESS [4.424s]
[INFO] QCforCC-war ....................................... SUCCESS [2.644s]
[INFO] QCforCC-ear ....................................... SUCCESS [1.478s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.081s
[INFO] Finished at: Thu Oct 08 13:45:05 ALMT 2015
[INFO] Final Memory: 26M/406M
[INFO] ------------------------------------------------------------------------
Process finished with exit code 0
但是当我部署时,我得到一个错误:
Connected to server
[2015-10-08 01:46:20,210] Artifact QCforCC-ear:ear exploded: Error during artifact deployment. See server log for details.
[2015-10-08 01:46:20,210] Artifact QCforCC-ear:ear exploded: java.io.IOException: com.sun.enterprise.admin.remote.RemoteFailureException: Error occurred during deployment: Exception while deploying the app [QCforCC-ear-1.0-SNAPSHOT] : Expected to find an expanded directory for submodule QCforCC-ejb-1.0-SNAPSHOT.jar but found a JAR. If this is a directory deployment be sure to expand all submodules.. Please see server.log for more details.
如果我在存档中打开EAR:
我的POM.XML EAR模块:
<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">
<parent>
<artifactId>QCforCC-main</artifactId>
<groupId>QCforCC-main</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>QCforCC-ear</artifactId>
<packaging>ear</packaging>
<name>QCforCC-ear</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>QCforCC-main</groupId>
<artifactId>QCforCC-ejb</artifactId>
<version>${project.parent.version}</version>
<type>ejb</type>
</dependency>
<dependency>
<groupId>QCforCC-main</groupId>
<artifactId>QCforCC-war</artifactId>
<version>${project.parent.version}</version>
<type>war</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>2.10.1</version>
<configuration>
<modules>
<ejbModule>
<groupId>QCforCC-main</groupId>
<artifactId>QCforCC-ejb</artifactId>
</ejbModule>
<webModule>
<groupId>QCforCC-main</groupId>
<artifactId>QCforCC-war</artifactId>
</webModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>
</project>
我做错了什么?我有EAR人工制品但无法部署它