我在 Java 7 中使用此配置
<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<id>1</id>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<xadditionalHeaders>true</xadditionalHeaders>
<executable>${tool.wsimport}</executable>
<wsdlDirectory>src/main/resources/wsdl</wsdlDirectory>
<target>2.1</target>
</configuration>
</execution>
</executions>
</plugin>
我必须将其迁移到 Java 17,更改版本后我收到这些错误
[WARNING] Failed to build parent project for com.sun.xml.ws:project:pom:2.2.8
Failed to build parent project for com.sun.xml.ws:project:pom:2.2.8
Failed to build parent project for com.sun.xml.ws:bundles:pom:2.2.8
Failed to build parent project for com.sun.xml.ws:jaxws-tools:pom:2.2.8
Invalid POM for com.sun.xml.ws:jaxws-tools:jar:2.2.8, transitive dependencies (if any) will not be available, enable debug logging for more details
我尝试使用 Java 11 迁移的解决方案进行迁移。但它们不起作用。我还尝试手动添加依赖项,下载 jars...但没有结果。我找不到 Java 17 的迁移指南。有帮助吗?
一定喜欢那些超级有用的专家消息。输出消息指示对应于 Java 8 的版本 2.2.8(com.sun.xml.bind:jaxb-core:jar:2.2.11 的 POM 无效,传递依赖项(如果有)将不会可用)。我的猜测是 org-jvnet-jax-ws-commons 与 JDK 17 根本不兼容,因此出现(无帮助的)maven 警告/错误。
参考: maven 无法执行目标 org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3:wsimport
更换
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.3</version>
与
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>4.0.1</version>
一旦我更改为 com.sun.xml.ws,错误就消失了。