Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在添加a后生成项目时出错<;jarModule>;对于maven pom.xml:工件不是项目的依赖项_Maven_Pom.xml_Maven Ear Plugin - Fatal编程技术网

在添加a后生成项目时出错<;jarModule>;对于maven pom.xml:工件不是项目的依赖项

在添加a后生成项目时出错<;jarModule>;对于maven pom.xml:工件不是项目的依赖项,maven,pom.xml,maven-ear-plugin,Maven,Pom.xml,Maven Ear Plugin,我已经在我的mavenpom.xml文件中添加了一个新的 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-ear-plugin</artifactId> ............ <jarModule> <groupId>javax.transaction</grou

我已经在我的maven
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>

org.apache.maven.plugins
maven耳朵插件
............
javax.transaction
jta
真的
............
在我添加此
之前,所有的项目构建都是正确的

错误如下所示:

[ERROR]无法执行目标org.apache.maven。插件:maven ear插件:2.6:在项目上生成应用程序xml(默认生成应用程序xml):工件[jar:javax.transaction:jta]不是项目的依赖项。


我做错了什么?我错过了什么吗?谢谢。

我确认您需要在项目依赖项部分添加依赖项:

<project>
  <dependencies>
    <dependency>
      <groupId>javax.transaction</groupId>
      <artifactId>jta</artifactId>
      <version>x.y</version>
      <type>jar</jar>
    </dependency>
即使我的依赖在那里

但是我在所说的依赖项中缺少了
ejb

artifactGroupId-artifactId-true@RaghunandanKrishnamurthy:这是什么?通常您只向ear添加war的/ejb模块。或者,如果您添加了jar,那么您必须在之前将它们添加到依赖项部分(这就是错误消息所提到的)。@khmarbaise:true此标记的含义是什么?请查看错误消息
不是项目的依赖项。
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.