Maven jaxws Failed to execute wsgen

I am using netbeans with maven 3. When I try to compile using 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 I get. I tried adding tools.jar using a system 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] 
+4
source share
3 answers

As a first step, make sure you are using maven with the correct version of java - jaxws: wsgen (1.12) seems to work with java 7 , in which case use java 6 , i.e .:

  • if you run it from the shell, export JAVA_HOME=/path/to/java/6
  • If you are using it from the IDE, specify the java version when starting the IDE
    • eg. for eclipse use the -vm /path/to/java/6 startup -vm /path/to/java/6

For me, this solved Failed to execute wsgen caused by com.sun.xml.bind.v2.runtime.IllegalAnnotationsException .

+11
source

Try using the updated version of the plugin from the JAX-WS community project.

 <groupId>org.jvnet.jax-ws-commons</groupId> <artifactId>jaxws-maven-plugin</artifactId> <version>2.2</version> 
+10
source

The project just returned to MojoHaus, so you should use the latest version there .

  • <2007: 1.0-1.12 (groupId org.codehaus.mojo)
  • 2007-2015: 2.1-2.3.1 (groupId org.jvnet.jax-ws-commons)
  • 2015-today: > = 2.4 (groupId org.codehaus.mojo)

The original code was developed in the Codehaus Mojo project, then as of March 2007 the project switched to jax-ws-commons with version 1.x in org.codehaus.mojo groupId and version 2.x in org.jvnet.jax-ws- commons groupId. In September 2015, for version 2.4, he returned to MojoHaus (the new Codehaus Mojo home) at org.codehaus.mojo groupId

 <dependency> <groupId>org.codehaus.mojo</groupId> <artifactId>jaxws-maven-plugin</artifactId> <version>2.5</version> </dependency> 
+1
source

Source: https://habr.com/ru/post/1389716/


All Articles