I am building a database partition, sub-table, due to JDBC3 (implemented in jdk1.5) and JDBC4 (implemented in the jdk1.6) there are considerable differences between the two specifications, resulting in no matter which JDK to compile, will lead to the entire Pom tree can not be built correctly, there is always a problem. said the actual problem card for a long time, and finally research maven compiled plug-ins, only to really solve.
The workaround is to define the following compilation plug-in in the main pom:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<build> [...] <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> < Artifactid>maven-compiler-plugin</artifactid> <version> 3.1</version> <configuration> <verbose>true</verbose>, <fork>true</ Fork> <executable>${jdk1.5javac}</executable> <compilerversion>1.5</compilerversion> </configuration> </plugin> </plugins> [...] </build> |
Add the following compilation plug-in to DBCLUSTERJDBC4:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<build> [...] <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> < Artifactid>maven-compiler-plugin</artifactid> <version> 3.1</version> <configuration> <verbose>true</verbose>, <fork>true</ Fork> <executable>${jdk1.6javac}</executable> <compilerversion>1.6</compilerversion> </configuration> </plugin> </plugins> [...] </build> |
Then define the Jdk1.5javac and Jdk1.6javac variables in the settings.xml and point to the Javac file for the two JDK.
In a MAVEN project, different modules need to be compiled from different JDK