I have JDK 8 installed on my machine. My code's POM has a Maven Compiler Plugin which uses source value as 1.7 and target as 1.8
I have JAXWS and JAXB dependency in my code. JDK 8 comes bundled with 2.2.9 version of JAXWS and JAXB. JDK 7 with 2.2.4 version of same jars
On doing Cross Compilation with Maven Install, which version of JAXWS or JAXB jar will be used? How to find the version of JAXWS and JAXB jar?
If it uses 2.2.9 (corresponding to JDK 8), how to ensure it uses 2.2.4 (corresponding to JDK 7) version?
Let me know for more information.
Best How To :
The API of the jars
has been made part of JDK with Java's version 6 and above.
What this actually means is that the API that is provided by these jars has been included within JDK's API. (To be precise, the API has been added to rt.jar) While making the API part of JDK's API, the package name of the API was kept the same as their name was in the jars.
For example, suppose a WEB SERVICE project does not include any of the JAXWS jars through Maven. Then in any class write
and we do simply do ctrl+shift+o in STS or Eclipse, then the imports will automatically include their fully Qualified imports as
import javax.jws.WebService; or
Assuming that your packageExplorer is linked with Editor, doing ctrl+click on any one of these imports will lead to shifting the package explorer view to the location of the Class File. This will be somewhere within rt.jar of the JDK.
==== On the other hand, if we provide JAXWS jars through Maven with COMPILE scope, and repeating the same steps above will lead the package explorer view to show the class file to be within a JAXWS Jar, not the rt.jar of the JDK.
This indicates that if JAXWS jars are made available as dependencies, JDK based JAXWS API is not used.