I want to configure Maven2 to use sun-java6-jdk to build Java SE 1.6 modules, and use openjdk-7 to build Java SE 1.7 modules. Is it possible?
Maven2 should then auto choose the correct JDK to build different modules in one command.
For example, it should be
$ mvn package
instead of
$ cd module1
$ update-alternatives ... jdk6 ...
$ mvn package
...
$ cd module2
$ update-alternatives ... jdk7 ...
$ mvn package
P.S. It's nothing about pom.xml files, which have already been setup maven-compiler-plugin
with different <source>
, <target>
values for different modules. If I choose to use openjdk-7, Maven2 will generate version 1.6 class files, but using openjdk-7 rather then sun-java6-jdk. The question is about how to configure Java SE profiles.