mojohaus / jaxws-maven-plugin

https://www.mojohaus.org/jaxws-maven-plugin/
Apache License 2.0
25 stars 37 forks source link

Java 9 support #71

Closed theit closed 4 years ago

theit commented 6 years ago

This pull requests adds support for invocation under Java 9-11 and fixes #54.

olgrosTrackit commented 6 years ago

How can I help testing?

theit commented 6 years ago

How can I help testing?

Well, checkout the code, apply my patches (see above) and check in your project / code whether everything still works ;-) According to the source code the following (dependency) artifacts are treated as endorsed artifacts, i.e. added to the bootclasspath when the plugin is being used in Java 8, i.e. "-Xbootclasspath:..." as command line option in the executed Java process:

When being used in Java >=9, they should be added directly to the classpath. Does everything still work in your environment?

hugo-ma-alves commented 6 years ago

Hello @theit Thanks for the fix.

I've download and compiled your branch and it is working on java 11. Basically we couldn't jaxws-maven-plugin with java 11, it threw the "-Xbootclasspath/p is no longer a supported" error.

Our setup is something like this:

`

org.codehaus.mojo
            <artifactId>jaxws-maven-plugin</artifactId>
            <version>2.6-SNAPSHOT</version>
            <configuration>
                <vmArgs>
                    <vmArg>-Djavax.xml.accessExternalSchema=all</vmArg>
                </vmArgs>
            </configuration>
            <executions>
                <execution>
                    <id>SampleWsdl</id>
                    <goals>
                        <goal>wsimport</goal>
                    </goals>
                    <configuration>
                        <wsdlDirectory>${basedir}/src/main/resources/wsdl</wsdlDirectory>
                        <bindingDirectory>${basedir}/src/main/jaxws</bindingDirectory>
                        <bindingFiles>
                            <bindingFile>bindings_SampleWsdl.xml</bindingFile>
                        </bindingFiles>
                        <wsdlFiles>
                            <wsdlFile>SampleWsdl.wsdl</wsdlFile>
                        </wsdlFiles>
                        <wsdlLocation>/wsdl/SampleWsdl.wsdl</wsdlLocation>
                    </configuration>
                </execution>

`

Do you have any idea when this PR will be merged?

theit commented 6 years ago

Hello @hugo-ma-alves ,

thanks for confirming that my PR works in your environment. Regarding your question: This depends on the maintainers / owners of this project. @andham and @hboutemy: You have created the last releases. WDYT?

AlexKovalevich commented 5 years ago

Thanks for the PR. This fix does work and solves the issue with -Xbootclasspath/p. This fix is definitely needs to be merged and the new version of plugin should be released cause it is a major issue for Java9+.

carlam16 commented 5 years ago

I am seeing the same error, any update on this issue ?

niko-dunixi commented 5 years ago

I am also running into this issue. Any ETA on this pull request? Our organization has mandated that we must have Java 11 for all our applications and this definitely blocks us. I've resorted to using the fork someone was kind enough to publish, but I imagine that keeping everything centralized and merging this will prevent more divergent versions of the plugin as Java continues to evolve

jackdpeterson commented 5 years ago

Is this project dead? Or is there something that's blocking this from getting merged in that the community can help push forward? I'd love to see this working when working with third-party integrations that are SOAP based :-P

andham commented 5 years ago

The project is not dead, but I guess there isn't much attention to it from us developers. Personally I'm currently not using jaxws. However, I totally understand the need for this to be Java 11 compatible.

theit commented 5 years ago

Do you need someone to help in supporting the development of this plugin? If yes, I could help out; we're using this plugin in our company...

andham commented 5 years ago

@theit We're always looking for people to help us at Mojohaus maintaining our mojos. Let's start by getting this release out and we can take it from there. I can perform the actual release, but I will not have time to dig into the actual coding required. And there you can help. A new release would then focus on adding Java 11 support. I see no reason to support Java 9/10 though.

voipfuture commented 5 years ago

Just for the record: I'm using the patch for building multiple (admittedly simple in terms of SOAP usage) projects on OpenJDK 11 and it worked as a drop-in replacement. Thanks for your work.

andham commented 5 years ago

What's left now, I believe, is to restore the jaxwscommons-81 IT with some tweaks so it just executes for Java 8 platform. @theit is that something you could fix? Have a look here: https://maven.apache.org/plugins/maven-invoker-plugin/examples/selector-conditions.html (Also include a clear comment of why.)

theit commented 5 years ago

@andham: I thought about restoring the jaxwscommons-81 IT as it was, and adding a clone of it with the patches in the pom.xml for Java >= 9. That way it can be executed independent of the JDK you're using. What do you think?

andham commented 5 years ago

Unfortunately the jvnet issue tracker is not available any longer so we can't view the details of that issue (jaxwscommons-81), but the description in the pom states:

wsgen, wsimport - support tools from JDK

so I believe the purpose of the IT is to verify the executable config param. Thus, removing that removes the purpose of the test. I believe these "executables" are now scripts which are part of the JAX-WS RI (https://javaee.github.io/metro-jax-ws/). So you could have a look at how to auto-install these depending on the OS, and use that for Java 9+. Or maybe use that for alla Java versions. The distro is available as com.sun.xml.ws:jaxws-ri:2.3.2:zip in central repo.

GabrielBB commented 5 years ago

This fork is working good with Java 13 (released just some days ago) : https://github.com/phax/jaxws-maven-plugin

andham commented 5 years ago

@theit Do you agree with my last comment and do you think it's something you can fix?

OmarHawk commented 5 years ago

Are there any news on when this could be finished up?

andham commented 5 years ago

We need to update the jaxwscommons-81 IT.

clagenna commented 4 years ago

I've tryed with jdk 13 and works like a charm! Good job!

andham commented 4 years ago

I've merged this PR. Thanks for contributing. However, the jaxwscommons-81 IT needs to be fixed before a release.

theit commented 4 years ago

Hi,

sorry for the very long delay; I was a bit too busy with $DAYJOB and personal things...

The problem with the IT is that it defines an executable to use for the wsgen(-test) and the wsimport(-test) goals. These exist in Java 8, but not anymore in Java 11. The PR simply removes these entries so that the Mojo calls the Java classes directly instead of the executables in the Java installation which - as far as I understand - only start the JVM and call the same Java classes as the Mojo and feed them with the given parameters...

Anyway. To restore the IT behavior for Java 8 I was thinking about creating two profiles: one for Java <= 8, and one for Java >= 9. They contain the same build/plugins/plugin block but differ only in the definition for the executable that would be available only in the Java <= 8 profile and that is missing in the Java >= 9 profile.

The downside of this is that it would blow up the pom.xml by ~100 lines because the plugin definition contains six execution blocks, and I actually don't see a simpler way to do this.

WDYT?

andham commented 4 years ago

@theit see comment in https://github.com/mojohaus/jaxws-maven-plugin/pull/71#issuecomment-532816482

andham commented 4 years ago

For everybody following this, a release vote for v2.6 has started: https://groups.google.com/forum/#!topic/mojohaus-dev/OeRAr6AxamE

phax commented 4 years ago

And the majority decided unanimously :D