jaxws-maven-plugin not picked up for generating sources
See original GitHub issueWe have a project which generates java classes from a .wsdl file. Our jenkins server successfully compiles the project from scratch but our Eclipse IDE configuration requires extra maven lifecycle mapping plugin com.coderplus.m2e.jaxws.
VS Code seems not to be picking up the plugin to generate the wsimport sources.
Environment
- Operating System: Windows
- JDK version: JDK 8
- Visual Studio Code version: 1.24.1
- Java extension version: 0.26
Steps To Reproduce
- Open maven project with jaxws-maven-plugin configured
- Wait until java language server finishes
- Expect target/generated-sources/ folder
Current Result
${project.build.directory}/generated-sources/wsimport is not created
Expected Result
wsimport sources are generated
Additional Informations
<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<id>wsimport-external-services</id>
<goals>
<goal>wsimport</goal>
</goals>
</execution>
</executions>
<configuration>
<wsdlDirectory>src/main/resources/com/a/b/c/soap</wsdlDirectory>
<wsdlFiles>
<wsdlFile>External_Service.wsdl</wsdlFile>
</wsdlFiles>
<implDestDir>${project.build.directory}/generated-sources/wsimport</implDestDir>
<packageName>com.a.b.c.soap</packageName>
<xjcArgs>
<xjcArg>-mark-generated</xjcArg>
</xjcArgs>
<keep>true</keep>
<genJWS>false</genJWS>
<!-- Needed when JDK_Version >= 8 -->
<vmArgs>
<vmArg>-Djavax.xml.accessExternalSchema=all</vmArg>
</vmArgs>
</configuration>
</plugin>
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:10 (4 by maintainers)
Top Results From Across the Web
maven jaxws-maven-plugin not adding generated packaged ...
I get all my classes inside target>generated-sources>wsimport> path. But the classes aren't being added to my classpath. So my project does not ......
Read more >JAX-WS Maven Plugin – jaxws:wsimport - MojoHaus
Specify where to place generated source files, keep is turned on with this option. Type: java.io.File; Required: No; Default: ${project.build.
Read more >Maven generate sources and update all folders does not ...
We have a project which generates java classes from WSDL at compile time using the maven-jaxws-plugin wsimport goal. The default phase that wsimport...
Read more >Jaxws Maven Plugin Wsimport Example | TOPDIVE
These generated sources included the wsimport maven will parse a java ... wsimport plugin to this server is not so the plugins to...
Read more >Maven cxf-codegen-plugin (WSDL to Java) - Apache CXF
By running mvn generate-sources, CXF will generate artifacts in the <sourceRoot> directory that you specify. Each <wsdlOption> element corresponds to a WSDL ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok so, m2e, the underlying Maven integration project, doesn’t know if the jaxws maven plugin is safe to run during the workspace build. The problem is visible when running in Eclipse, where you might be able to install an m2e-jaxws plugin, but is somewhat hidden in jdt.ls/vscode-java.
Anyways, one way to workaround this issue is to let m2e run the plugin during its project configuration phase. One way to do that is to add a processing instruction in the pom.xml like
<?m2e execute onConfiguration?>
in :You then need to let vscode update the project configuration:
Or you can execute the “Update project configuration” command manually:
I have the same problem as @kanchev : Even though the maven plugin
jaxws-maven-plugin
is defined in pom.xml; after VSCode starts up, the java language server does not generate files into target/generated-sources/ nor target/classes/.I have to run
$ mvn package
manually to make the maven pluginjaxws-maven-plugin
generate files into target/generated-sources/.After running
$ mvn package
, the language server also does not recognize imports from target/generated-sources/ because it keep regenerating target/classes/ folder and deleting all the class files created by$ mvn package
from target/generated-sources/ .