gpt4 book ai didi

maven jaxws 无法执行 wsgen

转载 作者:行者123 更新时间:2023-12-03 18:13:13 34 4
gpt4 key购买 nike

我在 maven 3 中使用 netbeans。当我尝试使用 jaxws-maven-plugin 进行编译时,出现以下错误。

这是我的 pom

 <build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<executions>
<execution>
<id>teamWS</id>
<goals>
<goal>wsgen</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<resourceDestDir>${project.build.directory}/classes/wsdl</resourceDestDir>
<sei>xyz.timerserver.server.TimeServer</sei>
<genWsdl>true</genWsdl>
<keep>true</keep>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>

<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
</dependency>

<dependency>
<groupId>javax.jws</groupId>
<artifactId>jsr181-api</artifactId>
<version>1.0-MR1</version>
</dependency>

<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
</dependency>

</dependencies>

这是我收到的错误消息。我尝试使用系统范围依赖添加 tools.jar 但仍然没有运气
Failed to execute goal org.codehaus.mojo:jaxws-maven-plugin:1.10:wsgen (teamWS) on project JWSServer: Failed to execute wsgen: com/sun/mirror/apt/AnnotationProcessorFactory: com.sun.mirror.apt.AnnotationProcessorFactory -> [Help 1]

最佳答案

作为第一步,请确保您使用正确的 Java 版本运行 maven -- jaxws:wsgen (1.12) 似乎与 发生故障Java 7 ,在这种情况下使用 Java 6 , IE。:

  • 如果从 shell 运行它,export JAVA_HOME=/path/to/java/6
  • 如果您从 IDE 运行它,请在 IDE 启动时指定 java 版本
  • 例如为 eclipse , 使用启动选项 -vm /path/to/java/6

  • 对我来说,这解决了 Failed to execute wsgencom.sun.xml.bind.v2.runtime.IllegalAnnotationsException 引起.

    关于maven jaxws 无法执行 wsgen,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8763595/

    34 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com