我在maven <jarModule>
文件中添加了新的pom.xml
。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
............
<jarModule>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<excluded>true</excluded>
</jarModule>
............
</plugin>
所有项目构建都正确发生,直到我添加了<jarmodule>
。
错误将如下所示:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-ear-plugin:2.6:generate-application-xml (default-generate-application-xml) on project ABCD : Artifact[jar:javax.transaction:jta] is not a dependency of the project.
我在这里做错了什么?有没有我错过的东西?感谢。
答案 0 :(得分:0)
我确认您需要在项目依赖项部分中添加一个依赖项:
<project>
<dependencies>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>x.y</version>
<type>jar</jar>
</dependency>
用正确的版本替换x.y
。
请注意<type>jar</jar>
。我有类似的错误:
Failed to execute goal org.apache.maven.plugins:maven-ear-plugin:2.7:generate-application-xml
(default-generate-application-xml) on project xxx:
Artifact[ejb:a.group:anArtifact] is not a dependency of the project.
即使我的依赖在那儿!
但我说的依赖项中缺少<type>ejb</type>
。