简体   繁体   中英

Maven Failed to initialize ear modules: Unknown artifact type[zip] for release-documentation

Environment:

  • Java 11
  • Maven 3.6.3

I added the following dependency on submodule pom.xml EJB and the problem came up

    <dependency>
        <groupId>com.sun.xml.ws</groupId>
        <artifactId>jaxws-ri</artifactId>
        <version>2.3.3</version>
        <type>pom</type>
    </dependency>

pom.xml root

   <dependencyManagement>
      <dependencies>
      ...
            <dependency>
                <groupId>org.jvnet.mimepull</groupId>
                <artifactId>mimepull</artifactId>
                <version>1.9.13</version>
            </dependency>
            <dependency>
                <groupId>com.sun.activation</groupId>
                <artifactId>jakarta.activation</artifactId>
                <version>1.2.2</version>
            </dependency>
            <dependency>
                <groupId>com.sun.xml.bind</groupId>
                <artifactId>jaxb-jaxb-xjc</artifactId>
                <version>2.3.3</version>
            </dependency>
            <dependency>
                <groupId>com.sun.xml.bind</groupId>
                <artifactId>jaxb-impl</artifactId>
                <version>2.1.13</version>
            </dependency>
            <dependency>
                <groupId>javax.xml.bind</groupId>
                <artifactId>jaxb-api</artifactId>
                <version>2.3.1</version>
            </dependency>
            <dependency>
                <groupId>javax.xml.bing</groupId>
                <artifactId>jaxb-api</artifactId>
                <version>2.3.1</version>
            </dependency>
      ...
      </dependencies>
   </dependencyManagement>

pom.xml (ear)

<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>
        <groupId>es.domain.app</groupId>
        <artifactId>app2</artifactId>
        <version>8.0.0</version>
    </parent>

    <artifactId>app-ear</artifactId>
    <packaging>ear</packaging>
    <name>app-ear</name>
    <description>Arxiu d'aplicacio EAR de app</description>
  
    <dependencies>
        <!-- Especificacions i llibreries proporcionades per JBoss -->
        <dependency>
            <groupId>org.jboss.spec</groupId>
            <artifactId>jboss-javaee-8.0</artifactId>
            <type>pom</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- Mòduls que van dins l'application.xml -->
        <dependency>
            <groupId>es.domain.app</groupId>
            <artifactId>app-back</artifactId>
            <type>war</type>
        </dependency>
        <dependency>
            <groupId>es.domain.app</groupId>
            <artifactId>app-commons</artifactId>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>es.domain.app</groupId>
            <artifactId>app-ejb</artifactId>
            <type>ejb</type>
        </dependency>
        <dependency>
            <groupId>es.domain.app</groupId>
            <artifactId>app-front</artifactId>
            <type>war</type>
        </dependency>
        <dependency>
            <groupId>es.domain.app</groupId>
            <artifactId>app-ws</artifactId>
            <type>ejb</type>
        </dependency>
    </dependencies>
  
    <build>
        <finalName>${project.parent.artifactId}</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-ear-plugin</artifactId>
                <configuration>
                <generateApplicationXml>true</generateApplicationXml>
                <defaultLibBundleDir>lib</defaultLibBundleDir>
                <includeLibInApplicationXml>false</includeLibInApplicationXml>
                <outputFileNameMapping>@{artifactId}@-@{version}@.@{extension}@</outputFileNameMapping>
                <version>8</version>
                <archive>
                    <manifestEntries>
                        <project-version>${project.version}</project-version>
                        <project-buildtime>${maven.build.timestamp}</project-buildtime>
                        <scm-revision>${buildNumber}</scm-revision>
                    </manifestEntries>
                </archive>
                    <modules>
                        <webModule>
                            <groupId>es.domain.app</groupId>
                            <artifactId>app-back</artifactId>
                            <bundleFileName>app-back.war</bundleFileName>
                            <contextRoot>/app2back</contextRoot>
                        </webModule>
                        <ejbModule>
                            <groupId>es.domain.app</groupId>
                            <artifactId>app-ejb</artifactId>
                            <bundleFileName>app-ejb.jar</bundleFileName>
                        </ejbModule>
                        <webModule>
                            <groupId>es.domain.app</groupId>
                            <artifactId>app-front</artifactId>
                            <bundleFileName>app-front.war</bundleFileName>
                            <contextRoot>/app2front</contextRoot>
                        </webModule>
                        <ejbModule>
                            <groupId>es.domain.app</groupId>
                            <artifactId>app-ws</artifactId>
                            <bundleFileName>app-ws.jar</bundleFileName>
                        </ejbModule>
                    </modules>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.cargo</groupId>
                <artifactId>cargo-maven2-plugin</artifactId>
                <configuration>
                    <skip>false</skip>
                    <deployables>
                        <deployable>
                            <properties>
                                <name>${project.build.finalName}</name>
                            </properties>
                        </deployable>
                    </deployables>
                </configuration>
            </plugin>
            <!-- Defineix la propietat ${buildNumber} que s'empra al filtrat -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>

I have no issues with the following commands:

mvn dependency:resolve
mvn dependency:tree

No clue how to find out what is happening...

Error log

...
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-ear-plugin:3.1.0:generate-application-xml (default-generate-application-xml) on project app-ear: Failed to initialize ear modules: Unknown artifact type[zip] for relea
se-documentation -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :app-ear
...

Try excluding the documentation. You may also have to exclude samples.

       <dependency>
          <groupId>com.sun.xml.ws</groupId>
          <artifactId>jaxws-ri</artifactId>
          <version>2.3.3</version>
          <type>pom</type>
          <exclusions>
            <exclusion>
                <groupId>com.sun.xml.ws</groupId>
                <artifactId>release-documentation</artifactId>
            </exclusion>
            <exclusion>
                <groupId>com.sun.xml.ws</groupId>
                <artifactId>samples</artifactId>
            </exclusion>
          </exclusions>
        </dependency>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM