[
http://jira.codehaus.org/browse/MCOMPILER-125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=217546#action_217546
]
redstun commented on MCOMPILER-125:
-----------------------------------
The subject of this issue should have been
- Maven should respect platform default source/target levels and warn the user
to explicitly set them.
:-)
> Maven should not set default Java source target level
> -----------------------------------------------------
>
> Key: MCOMPILER-125
> URL: http://jira.codehaus.org/browse/MCOMPILER-125
> Project: Maven 2.x Compiler Plugin
> Issue Type: Improvement
> Affects Versions: 2.0, 2.0.1, 2.0.2, 2.1, 2.2
> Reporter: redstun
>
> Expectation:
> The Maven Compiler Plugin, as it is just a wrapper of the underlying
> compiler (javac by default), should not change the default source/target
> levels of the underlying compiler, or specifying any hard coded values, FOR
> the user.
> Fact:
> As described in the plugin homepage
> (http://maven.apache.org/plugins/maven-compiler-plugin/index.html), "The
> default source setting is 1.3 and the default target setting is 1.1,
> independently of the JDK you run Maven with."
> And people have been complaining against this, For that the default
> source/target levels are either inappropriate or outdated. See MCOMPILER-80,
> MCOMPILER-46, MCOMPILER-124. Plus that MCOMPILER-80 has been re-opened
> recently soon after it's fixed.
> Up to now, the filed issues are all about to change the default
> source/target levels to more 'current' values, but whatever the values are
> set to, they will sooner or later fall out of date, this is why we have
> several requests like this over time, as listed above. They all represent a
> resolution for 'now', not for all the time.
> On the contrary, Ant is doing this as expected, As in
> http://ant.apache.org/manual/CoreTasks/javac.html, it always defaults the
> source/target levels to the javac in use, and clarifies that the users are
> "highly recommended to always specify them".
> And As a result, Ant never gets complaints regarding the issues we filed
> against Maven Compiler Plugin.
> Additionally, Eclipse is using the default values from the JDK in use as
> well. if we create a project with mvn archetype:generate, then mvn
> eclipse:eclipse and import it into Eclipse, you'll see that Eclipse does it
> like Ant. Keep the project open in Eclipse and do a mvn compile outside (or
> phases that depend on it, such as mvn package), you'll see a weird compile
> error in Eclipse with no obvious clue. At the beginning you won't 'see' that
> the problem is caused by Maven, to be specific, the source/target levels set
> by Maven FOR you.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira