为什么我面临 org.pache.cxf 问题,即使我使用的版本与 apache cxf 文档提到的 apache cxf with java 9 支持 3.3.X 版本但我收到错误的版本相同。任何帮助都会很好地解决这个问题。下面是我的 POM 文件,其中包含所需的依赖项。
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web-services</artifactId>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-ws-security</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.moxy</artifactId>
<version>3.3.0</version>
</dependency>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
</plugin>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>3.3.0</version>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-bindings-soap</artifactId>
<version>3.3.0</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>generate-jaxb</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${project.build.directory}/generated-sources/afxlink</sourceRoot>
<additionalJvmArgs>-Dfile.encoding=UTF8</additionalJvmArgs>
<wsdlOptions>
<wsdlOption>
<wsdl>https://test.com/sample.svc?wsdl</wsdl>
<!-- <wsdl>${basedir}/src/main/resources/wsdl/ABC.wsdl</wsdl> -->
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
产生的错误:
ERROR] Failed to execute goal org.apache.cxf:cxf-codegen-plugin:3.3.0:wsdl2java (generate-jaxb) on project tobp:
[ERROR] Exit code: 1
[ERROR] Command line was: "C:\Program Files\Java\jdk-9.0.4\bin\java.exe" --add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED --add-exports=java.xml/com.sun.org.apache.xerces.internal.impl.xs=ALL-UNNAMED --add-opens java.base/java.security=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED -Dfile.encoding=UTF8 -jar C:\Users\XXXXX\AppData\Local\Temp\cxf-tmp-13521710507515144969\cxf-codegen8120209960104723950.jar C:\Users\XXXXX\AppData\Local\Temp\cxf-tmp-13521710507515144969\cxf-w2j13650852005823843615args
[ERROR] -> [Help 1]