我正在构建一个包含EJB的ear,其中包含一些与我的JBoss服务器中已存在的jar冲突的轴jar。我有两个在轴上具有子依赖关系的依赖项。一个是直接依赖它,另一个是第三级传递依赖。
我排除了我不想要的特定罐子,但我仍然在依赖树中看到它们。
这就是maven-ear-plugin的相关部分:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>2.10</version>
<configuration>
<version>6</version>
<applicationName>${jboss_toolkit_ear_deployment_name}</applicationName>
<modules>
<-- modules with transitive dependencies on axis jars -->
<ejbModule>
<groupId>com.mycomp.myproject</groupId>
<artifactId>myejbmodule</artifactId>
</ejbModule>
<ejbModule>
<groupId>com.mycomp.otherproject</groupId>
<artifactId>otherejbmodule</artifactId>
</ejbModule>
<jarModule>
<groupId>axis</groupId>
<artifactId>axis</artifactId>
<excluded>false</excluded> <!-- required -->
</jarModule>
<jarModule>
<groupId>axis</groupId>
<artifactId>axis-wsdl4j</artifactId>
<excluded>true</excluded>
</jarModule>
<jarModule>
<groupId>org.apache.axis</groupId>
<artifactId>axis-jaxrpc</artifactId>
<excluded>true</excluded>
</jarModule>
<jarModule>
<groupId>org.apache.axis</groupId>
<artifactId>axis-saaj</artifactId>
<excluded>true</excluded>
</jarModule>
构建之后,这是我的依赖树:
[INFO] +- com.mycomp.myproject:myejbmodule:ejb:4.3-SNAPSHOT:compile
[INFO] | +- commons-io:commons-io:jar:1.4:compile
[INFO] | \- axis:axis:jar:1.4:compile
[INFO] | +- org.apache.axis:axis-jaxrpc:jar:1.4:compile
[INFO] | +- org.apache.axis:axis-saaj:jar:1.4:compile
[INFO] | +- axis:axis-wsdl4j:jar:1.5.1:runtime
[INFO] | +- commons-logging:commons-logging:jar:1.0.4:compile
[INFO] | \- commons-discovery:commons-discovery:jar:0.2:runtime
我尝试从其中一个依赖项中排除其中一个轴罐
<dependency>
<groupId>com.mycomp.myproject</groupId>
<artifactId>myejbmodule</artifactId>
<version>${myejbmodule-version}</version>
<type>ejb</type>
<exclusions>
<exclusion>
<groupId>org.apache.axis</groupId>
<artifactId>axis-jaxrpc</artifactId>
</exclusion>
</exclusions>
</dependency>
但是当我构建时,我收到以下错误:
[错误]无法在项目上执行目标org.apache.maven.plugins:maven-ear-plugin:2.10:generate-application-xml(default-generate-application-xml)someproject-ear:Artifact [jar: org.apache.axis:axis-jaxrpc]不是项目的依赖项。 - &GT;
知道我做错了吗?