You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "redstun (JIRA)" <ji...@codehaus.org> on 2010/01/29 18:44:55 UTC

[jira] Commented: (MCOMPILER-80) Change default source level to 1.5

    [ http://jira.codehaus.org/browse/MCOMPILER-80?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=208618#action_208618 ] 

redstun commented on MCOMPILER-80:
----------------------------------

I think the default source and target level for maven compiler should be the same as that of the java being used to invoke Maven.

i.e. 
java 1.4 => source 1.4, target 1.4
java 1.5 => source 1.5, target 1.5
java 1.6 => source 1.6, target 1.6

that is to say maven should follow the default source/target level settings in javac, as in the blog
http://blogs.sun.com/darcy/entry/source_target_class_file_version of Joseph D. Darcy.

Default javac Source and Target Settings

† JDK 1.4.0 and 1.4.1 only accepted source 1.3 and 1.4.
JDK/J2SDK 	Default Source 	Source Range 	Default Target 	Target Range
1.0.x 	1.0 	— 	1.1 	—
1.1.x 	1.1 	— 	1.1 	—
1.2.x 	1.2 	— 	1.1 	1.1 - 1.2
1.3.x 	1.2/1.3 	— 	1.1 	1.1 - 1.3
1.4.x 	1.2/1.3 	1.2† - 1.4 	1.2 	1.1 - 1.4
5 	1.5 	1.2 - 1.5 	1.5 	1.1 - 1.5
6 	1.5 	1.2 - 1.6 	1.6 	1.1 - 1.6
7 	1.7 	1.2 - 1.7 	1.7 	1.1 - 1.7


> Change default source level to 1.5
> ----------------------------------
>
>                 Key: MCOMPILER-80
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-80
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Improvement
>            Reporter: Grzegorz Borkowski
>            Priority: Minor
>
> Deafult source level setting for Maven compiler plugin is 1.3, as far as I remember. This makes no sense. 1.3 is used at this moment only in legacy applications. Probability of porting such legacy application to Maven 2 is very small. I was working with such applications - none of them used Maven. In fact, I don't know any application using Maven, which requires level 1.3.  
> On the other hand, Maven is used exensively in new applications. Most of them use Java 5 features (annotations, generics...). All new applications I create use Maven 2 and Java 5. Every time I setup such application it makes me crazy that I get errors on my generics and annoations, and I have to setup manually the source level to 1.5. Come on, we have year 2008, not 2000! Java 5 is here for several years already. So why Maven compiler plugin does not use the most reasonable default approach, instead it still assumes we are in 2000 year? If someone wants to use old java version, than he can change the source level. By default should be 1.5.
> The default setting can be changed in never wersion of maven compiler plugin.

-- 
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