1
votes

Desperatley trying to create a EAR bundle with some modules, using the maven EAR plugin version 2.10.1 with Maven 3. There is a problem with the generate-application-xml goal, I´m getting the error:

Failed to execute goal org.apache.maven.plugins:maven-ear-plugin:2.10.1:generate-application-xml (default-generate-application-xml) on project wineapp-ear: Unable to parse configuration of mojo org.apache.maven.plugins:maven-ear-plugin:2.10.1:generate-application-xml for parameter version: Cannot find 'version' in class org.apache.maven.plugin.ear.EjbModule -> [Help 1]

here is the pom.xml snippet:

<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>

what the hack is wrong here? or is it just a f.. typo in the xml? inside the configuration element, the automatic tag detection by IDE (how is the word for that..) also not working, but i compared it with examples nearly a thousand times. don´t know what else matters for error finding, there´s also a parent pom

1

1 Answers

3
votes

An module did not have a version tag see modules. The version is already defined by the dependency blog and the module blog is just use for renaming the artifacts in the ear file (since you define a new bundleFileName). So try to remove all version tags in your modules like this:

           <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>

Or better remove the complete modules blog because I do not think its important for you to rename the dependencies in the ear and it is OK to use the Maven default names.