highsource / highsource/jaxb-tools
maven running with jdk1.8 and projet compiled with jdk1.7, but jaxb2 plugin is using jdk1.8
- Dominant language
- Java
- Stars
- 465
- Forks
- 105
- PR merge metrics
- No merged PRs in 30d
Description
Hi, thanks for the help in advance!
Can you help us to find what we are doing wrong? please
We have an issue with the jdk version being use by maven-jaxb2-plugin.
### Background;
- For security reasons we have to upgrade our enviroment jdk version to 1.8 (JAVA_HOME), but the project must be compiled by jdk 1.7
- Jenkins is who build the release.
- The build process ends succesfully.
- The problem is happends when we tried to deploy the ear in weblogic server running java 1.7
### Expectations;
how the plugin jaxb2 can be force to use jdk 1.7 in the compilation process?
### Details;
In our parent pom, we added the plugin toolchain to be able to compile in java 1.7 the diff modules contained in the parent. This works fine for are the modules related in the project.
```
org.apache.maven.plugins
maven-compiler-plugin
1.7
1.7
org.apache.maven.plugins
maven-compiler-plugin
2.3.2
true
true
1.7
1.7
${JAVA_1_7_HOME}/bin/javac
org.apache.maven.plugins
maven-toolchains-plugin
1.1
toolchain
1.7
sun
```
Everthing is working just find except the plugin maven-jaxb2-plugin which is using java 1.8 for some reason.
Marks in the compilation log thet jdk1.8 is being used.
```
[mvn] [INFO] JAXB API is loaded from the [jar:file:/opt/jdk1.8.0_261/jre/lib/rt.jar!].
[mvn] [INFO] Detected JAXB API version [2.2].
```
The error that we have is when we tried to deployed the ear file in weblogic.
```
Message icon - Error An error occurred during activation of changes, please see the log for details.
Message icon - Error Failed to load webapp: WebServices because of DeploymentException: java.lang.UnsupportedClassVersionError: com/.../definition/NotificationPaymentService : Unsupported major.minor version 52.0
Message icon - Error com/.../definition/NotificationPaymentService : Unsupported major.minor version 52.0
```
We lookup into the documentation and we tried the example showed in the page with no luck.
https://github.com/highsource/maven-jaxb2-plugin/wiki/Basic-Usage
This is the pom of the module where the plugin is implemented
```
true
org.apache.maven.plugins
maven-compiler-plugin
1.7
1.7
...
org.jvnet.jaxb2.maven2
maven-jaxb2-plugin
generate
src/main/resources/schemas/
com.....generated
notification.xsd
src/main/resources/bindings
simple.xjb
true
true
true
```
Contributor guide
Assessment
This issue has not been assessed yet.