By default the wsgen target compiles any generated classes as well, which is typically not how it should be done in a Maven project as the compilation should be handled by the maven-compile-plugin. But this is due to wsgen being a tool which is wrapped by the jaxws-maven-plugin. (However, the wsimport target does NOT compile the generated Java classes.)
You could try turning compilation off through the xnocompile [1] parameter. However, I recall this having some side-effect on the generated end result. I don't remember exactly what though. Test it and see if it produces what you need. Possibly you could specify 1.7 target through the vmArgs [2] parameter, but I haven't found any example on that. You could also use JDK tool chain [3] to specify a JDK 1.7 to be used for wsgen. [1] http://www.mojohaus.org/jaxws-maven-plugin/wsgen-mojo.html#xnocompile [2] http://www.mojohaus.org/jaxws-maven-plugin/wsgen-mojo.html#vmArgs [3] http://www.mojohaus.org/jaxws-maven-plugin/wsgen-mojo.html#useJdkToolchainExecutable /Anders On Thu, Jun 8, 2017 at 4:22 PM, Richard Tjerngren < [email protected]> wrote: > I’m using jaxws-maven-plugin to generate some java-files and compile them > to classes. I’m running JDK 8 on my machine but I want the output jars to > be compatible with java 7, I’ve configured the maven-compiler-plugin so all > my other jars are correct but it ’s seems like the jaxws-plugin doesn’t use > the compiler plugin. > > So my question is, how can I tell jaxws to compile with -source and > -target 1.7? > > > ps. This is my first time posting to a mailing list, I hope I’m doing this > right :) > > Regards > Richard > > > > > Richard Tjerngren > Java Developer > ──────────────── > NetEnt | Better Gaming™ > T: +46 760 024 868<tel:+46%20760%20024%20868>, M: +46 760 024 868 > <tel:+46%20760%20024%20868> > [email protected]<mailto:[email protected]>, > www.netent.com > Address: NetEnt AB (publ), Vasagatan 16, SE-111 20, Stockholm, SE > This email and any attachments are confidential and may be legally > privileged and protected by copyright. If you are not the intended > recipient of this email you should not copy it or disclose its contents to > anyone. If you have received this email in error, please notify the sender > immediately and delete the email. Views or opinions in this email are > solely those of the author. Unencrypted Internet communications are not > secure and the sender does not accept responsibility for interception of > this message by third parties. This communication is not intended to form a > binding contract unless expressly indicated to the contrary and properly > authorized. The recipient should scan this email and any attachments for > the presence of viruses. The sender accepts no liability for any viruses > transmitted in this email. >
