maven jaxws执行wsgen失败
我将 netbeans 与 maven 3 一起使用。当我尝试使用 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]
I am using netbeans with maven 3. When I try to compile with jaxws-maven-plugin, I get the following error.
Here is my 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>
This is the error message that I get. I tried to add tools.jar using system scope dependency but still no luck
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]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
第一步,确保您使用正确的 java 版本运行 Maven - 在这种情况下,jaxws:wsgen (1.12) 似乎在 java 7 上出现故障使用java 6,即:
export JAVA_HOME=/path/to/java/6
-vm /path/to/java/6
对我来说,这解决了
无法执行wsgen
由com.sun.xml.bind.v2.runtime.IllegalAnnotationsException
引起。As a first step, ensure that you're running maven with a correct java version -- jaxws:wsgen (1.12) appears to malfunction with java 7, in such a case use java 6, i.e.:
export JAVA_HOME=/path/to/java/6
-vm /path/to/java/6
For me, this solved the
Failed to execute wsgen
caused bycom.sun.xml.bind.v2.runtime.IllegalAnnotationsException
.尝试使用 JAX-WS commons 项目中插件的更新版本。
Try using updated version of the plugin from JAX-WS commons project.
该项目刚刚返回 MojoHaus,因此您应该使用那里的最新版本。
The project just went back to MojoHaus so you should use the latest version from there.
您可以使用官方示例配置,它可用 这里。
请检查他们使用的依赖项以避免编译错误。查看
mvn dependency:tree
输出:You can use the official example configuration, it is available here.
Please review the dependencies they are using to avoid compilation errors. See the
mvn dependency:tree
output: