首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >maven-ear-plugin,无法在类org.apache.maven.plugin.ear.EjbModule中找到“版本”

maven-ear-plugin,无法在类org.apache.maven.plugin.ear.EjbModule中找到“版本”
EN

Stack Overflow用户
提问于 2015-08-13 15:24:05
回答 1查看 4.5K关注 0票数 1

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片段:

代码语言:javascript
复制
<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。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-08-13 15:32:25

一个模块没有版本标签参见模块。依赖博客已经定义了版本,模块博客只是用于重命名ear文件中的工件(因为您定义了一个新的bundleFileName)。因此,尝试删除模块中的所有版本标记,如下所示:

代码语言:javascript
复制
           <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默认名称是可以的。

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31992427

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档