Maven未能初始化ear模块:发布文档的未知工件类型[zip]



环境:

  • Java 11
  • Maven 3.6.3

我添加了以下对子模块pom.xml EJB的依赖,问题出现在上

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

pom.xml根

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

我对以下命令没有问题:

mvn dependency:resolve
mvn dependency:tree

不知道如何发现正在发生的事情。。。

错误日志

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

尝试排除文档。您可能还必须排除示例。

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

最新更新