Description of problem:
DeltaSpike quickstarts specify '1.6' as their source and target version for the java compiler in maven compiler plugin's properties. When these quickstarts are imported into JBDS which has only a single 1.7 JRE configured, a warning is shown.
Version-Release number of selected component (if applicable):
Import any DeltaSpike quickstart into JBDS.
A warning is shown:
"Build path specifies execution environment JavaSE-1.6. There are no JREs installed in the workspace that are strictly compatible with this environment."
No warning should be shown. According to the documentation of the '-target' argument of the java compiler, classes that target a specified version will run on JRE of that version *or higher*.
Looking at this, that seems more like an eclipse / JBDS issue than DeltaSpike. Java 7 isn't as widespread yet (according to Max's numbers from Tools/JBDS) to switch over in the poms, plus DeltaSpike will probably never completely target Java 7.
I agree that this is an issue of JBDS, but I still wanted to have this (and a few similar ones) tracked but can't see any more appropriate component here in BZ (Tooling? JBDS?) so I filed it under DeltaSpike. How should other DeltaSpike+JBDS issues be classified?
I found an issue in Eclipse Bugzilla that describes this problem: https://bugs.eclipse.org/bugs/show_bug.cgi?id=373023 .
It is closed as invalid, so apparently there is no intention from Eclipse team to change this behaviour the benefit of which is IMHO dubitable in this case.
It might be worth documenting this as a known issue along with a workaround for getting rid of the warning.
Why do we have the compiler plugin in there?
One reason to specify the source/target version for maven-compiler-plugin is to support JBDS, which uses maven-compiler-plugin's configuration to infer the target JRE for the project.
Also, @pmuir, do you think these low severity issues regarding JBDS support should be documented? That includes this one, 980492 and 980532.
@rsmeral, I think we can document them easily, no?
@rsmeral could you file an upstream issue in JDF to remove the compiler plugin declaration. There is no reason for it to be there at all. JBDS will just use the latest JDK in this case.
It seems to be more complicated. There are three states, all of them showing a warning in JBDS:
* maven-compiler-plugin declared and maven.compiler.target property declared:
- described in original comment
* only maven.compiler.target property declared:
- JBDS (m2e) apparently takes this property into account, as it behaves the same as above, irregardless of whether maven-compiler-plugin is declared
* none of the above declared:
- here, JBDS assumes that the JRE is Java 1.5, not sure what this is based on.
IMHO, it is a good practice to have versions of plugins declared to support build stability. If for some reasons we really want to drop the compiler plugin declaration, we can keep the maven.compiler.target property and JBDS considers that as the target JRE.