我的整個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