[英]maven-ear-plugin, Cannot find 'version' in class org.apache.maven.plugin.ear.EjbModule
Desperatley尝试使用Maven 3的maven EAR插件版本2.10.1创建带有某些模块的EAR捆绑包。generate-application-xml目标存在问题,我得到了错误:
无法在项目wineapp-ear上执行目标org.apache.maven.plugins:maven-ear-plugin:2.10.1:generate-application-xml(default-generate-application-xml):无法解析mojo org的配置。 apache.maven.plugins:maven-ear-plugin:2.10.1:generate-application-xml用于参数版本:在类org.apache.maven.plugin.ear.EjbModule中找不到'version'-> [帮助1]
这是pom.xml片段:
<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">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>wineapp-parent</artifactId>
<groupId>com.jueggs</groupId>
<version>1.0.0</version>
</parent>
<artifactId>wineapp-ear</artifactId>
<packaging>ear</packaging>
<name>wineapp-ear</name>
<dependencies>
<dependency>
<groupId>com.jueggs</groupId>
<artifactId>wineapp-ejb</artifactId>
<version>1.0.0</version>
<type>ejb</type>
</dependency>
<dependency>
<groupId>com.jueggs</groupId>
<artifactId>wineapp-web</artifactId>
<version>1.0.0</version>
<type>war</type>
</dependency>
<dependency>
<groupId>com.jueggs</groupId>
<artifactId>wineapp-jpa</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.jueggs</groupId>
<artifactId>wineapp-common</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>2.10.1</version>
<configuration>
<!--<version>6</version>-->
<!--<applicationXml>/src/main/application/META-INF/</applicationXml>-->
<modules>
<ejbModule>
<groupId>com.jueggs</groupId>
<artifactId>wineapp-ejb</artifactId>
<version>1.0.0</version>
<bundleFileName>ejb.jar</bundleFileName>
</ejbModule>
<webModule>
<groupId>com.jueggs</groupId>
<artifactId>wineapp-web</artifactId>
<version>1.0.0</version>
<bundleFileName>web.war</bundleFileName>
</webModule>
<jarModule>
<groupId>com.jueggs</groupId>
<artifactId>wineapp-common</artifactId>
<version>1.0.0</version>
<bundleDir>lib</bundleDir>
<bundleFileName>common.jar</bundleFileName>
</jarModule>
<jarModule>
<groupId>com.jueggs</groupId>
<artifactId>wineapp-jpa</artifactId>
<version>1.0.0</version>
<bundleDir>lib</bundleDir>
<bundleFileName>jpa.jar</bundleFileName>
</jarModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>
这里的hack是怎么了? 还是仅仅是xml中的F ..错字? 在配置元素中,IDE的自动标记检测(这个词的意思是..)也不起作用,但是我将其与示例进行了近千次的比较。 不知道错误查找还有什么要紧的,还有一个父pom
一个模块没有版本标签,请参见modules 。 该版本已由依赖项博客定义,并且模块博客仅用于重命名ear文件中的工件(因为您定义了新的bundleFileName)。 因此,尝试像这样删除模块中的所有版本标签:
<modules>
<ejbModule>
<groupId>com.jueggs</groupId>
<artifactId>wineapp-ejb</artifactId>
<bundleFileName>ejb.jar</bundleFileName>
</ejbModule>
<webModule>
<groupId>com.jueggs</groupId>
<artifactId>wineapp-web</artifactId>
<bundleFileName>web.war</bundleFileName>
</webModule>
<jarModule>
<groupId>com.jueggs</groupId>
<artifactId>wineapp-common</artifactId>
<bundleDir>lib</bundleDir>
<bundleFileName>common.jar</bundleFileName>
</jarModule>
<jarModule>
<groupId>com.jueggs</groupId>
<artifactId>wineapp-jpa</artifactId>
<bundleDir>lib</bundleDir>
<bundleFileName>jpa.jar</bundleFileName>
</jarModule>
</modules>
或者最好删除完整的模块博客,因为我认为重命名依赖关系并不重要,可以使用Maven默认名称。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.