maven-ear-plugin,在 class org.apache.maven.plugin.ear.EjbModule 中找不到 'version'

maven-ear-plugin, Cannot find 'version' in class org.apache.maven.plugin.ear.EjbModule

Desperatley 尝试使用 Maven EAR 插件版本 2.10.1 和 Maven 3 创建一个包含一些模块的 EAR 包。generate-application-xml 目标有问题,我得到错误:

无法在项目 wineapp 上执行目标 org.apache.maven.plugins:maven-ear-plugin:2.10.1:generate-application-xml (default-generate-application-xml) -ear:无法解析 mojo org.apache.maven.plugins:maven-ear-plugin:2.10.1:generate-application-xml 参数版本的配置:在 [=29= 中找不到 'version' ] 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>

这里有什么问题?还是只是 f.. xml 中的拼写错误?在配置元素内部,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 默认名称是可以的。