我的整个pom.xml如下。有了这个pom,我在Eclipse中得到了这个错误:“生命周期配置中没有涉及的插件执行:org.apache.cxf:cxf-java2ws-plugin:3.1.8:java2ws(execution:process-classes,phase:process-classes)”。 尽管如此,它确实工作正常。我的意思是,如果我“mvn clean package install”,我得到所需的输出wsdl文件。当我拿走pluginManagement时,为什么我能够创建wsdl?
如果我添加了pluginManagement,Eclipse中的错误desapears,但我没有得到所需的wsdl文件,我也没有得到我的控制台中的错误。我发现的两个最接近的讨论是“Publishing wsdl java M2E plugin execution not covered”和“How to solve "Plugin execution not covered by lifecycle configuration" for Spring Data Maven Builds”,但我不理解它们。据我所看到的,这个想法是改变采取的
"<lifecycleMappingMetadata>...<action><execute/>".
我直的问题优点是:为什么当我带走pluginManagement不低于我的工程POM?我猜,我不确定是否缺少关于pluginManagement和执行之间关系的基本知识。我的问题中最相关的部分不是什么与Eclipse的worng(我发现很少人说忽略它)。
我一直在使用pluginManagement,但我从来不知道它为我的pom添加了什么额外功能。由于现在使用java2ws失败,我真的很想知道是否应该在我的pom中添加任何额外的配置,以便通过pluginManagement和goal> java2ws运行它。
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>grp</groupId>
<artifactId>art</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>art Maven Webapp</name>
<url>http://maven.apache.org</url>
<properties>
<jdk.version>1.8</jdk.version>
<cxf.version>3.1.8</cxf.version>
<spring.version>4.3.4.RELEASE</spring.version>
<!-- <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> -->
</properties>
<dependencies>
<!-- Spring dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Apache cxf dependencies -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
</dependency>
<!-- servlet & jsp -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.1.2</version>
</dependency>
</dependencies>
<build>
<finalName>art</finalName>
<!-- <pluginManagement> -->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-java2ws-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
<id>process-classes</id>
<phase>process-classes</phase>
<configuration>
<className>art.VmxService</className>
<outputFile>${project.basedir}/src/main/resources/VmxService.wsdl</outputFile>
<genWsdl>true</genWsdl>
<verbose>true</verbose>
<address>http://localhost:9080/art/VmxService</address>
</configuration>
<goals>
<goal>java2ws</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<!-- </pluginManagement> -->
</build>
</project>
Wemu,你肯定回答了我的问题100%。如果你是Eclipse用户,最后一个评论,你知道如何引发“eclipse中的警告更多地涉及到你的IDE的生命周期”吗? – DemeCarvO
对不起,我不熟悉日食的演变。我简单地忽略了过去的生命周期映射警告。这可能只是某个地方的验证设置?通常,Eclipse中的每个警告都可以被禁用或优先级改变。 – wemu