question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

jaxws-maven-plugin not picked up for generating sources

See original GitHub issue

We 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
  1. Open maven project with jaxws-maven-plugin configured
  2. Wait until java language server finishes
  3. 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:open
  • Created 5 years ago
  • Reactions:2
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
fbriconcommented, Oct 11, 2018

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 :

<plugin>
                <groupId>org.jvnet.jax-ws-commons</groupId>
                <artifactId>jaxws-maven-plugin</artifactId>
                <version>2.3</version>
                <executions>
                    <execution>
                        <?m2e execute onConfiguration?>
                        <goals>
                            <goal>wsimport</goal>
                        </goals>

You then need to let vscode update the project configuration: screen shot 2018-10-11 at 3 40 03 pm

Or you can execute the “Update project configuration” command manually: screen shot 2018-10-11 at 3 41 53 pm

2reactions
khe817commented, Oct 2, 2018

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 plugin jaxws-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/ .

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found