Desperatley试图使用maven 3的Maven EAR插件2.10.1版本创建一个带有一些模块的EAR包。
未能在项目wineapp-ear上执行org.apache.maven.plugins:maven-ear-plugin:2.10.1:generate-application-xml (默认生成-application-xml):无法为参数版本解析mojo org.apache.maven.plugins:maven-ear-plugin:2.10.1:generate-application-xml的配置:无法在org.apache.maven.plugin.ear.EjbModule ->帮助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>
这里有什么问题吗?还是它只是个..。在xml中输入错误?在configuration元素中,IDE自动检测标记(该词如何表示.)也不起作用,但我把它与例子进行了近千次的比较。不知道还有什么重要的错误发现,也有家长的pom。
发布于 2015-08-13 15:32:25
一个模块没有版本标签参见模块。依赖博客已经定义了版本,模块博客只是用于重命名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>或者最好删除完整的模块博客,因为我认为在ear中重命名依赖项并不重要,使用Maven默认名称是可以的。
https://stackoverflow.com/questions/31992427
复制相似问题