Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3
    • Labels:
      None
    • Number of attachments :
      0

      Description

      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.

        Issue Links

          Activity

          Hide
          Benjamin Bentmann added a comment -

          Done in r932664.

          Show
          Benjamin Bentmann added a comment - Done in r932664 .
          Hide
          Grzegorz Borkowski added a comment -

          I see it was fixed, setting default value to 1.5.
          However, I'm not that sure if it's the best choice, so I reopen it again for discussion. I reported this issue in 2008. At that time it seemed to me to be the logical value. However, if we fix it in 2010, the most logical value is 1.6, I think. Java 5 was scheduled to end-of-live in 2009, if I remember correctly. Java 6 is stable and mature. Probably 99% of projects starting in year 2010 will use Java 6, so they will have to override this setting anyway. The sense of "default" value is that most of people will not have to change it. In this context, if everybody is going to change it to 1.6 anyway, than it has no sense at all.
          I've just checked the project I'm working on now. It has compiler level set to 1.6. Probably, two years ago when this issue was reported, it was 1.5.
          As the Java 7 is not that likely in the near future to come (I'm not the best informed guy on this topic, but that's the popular feeling I think), than using 1.6 as default value has a chance to be valid for several years.

          Show
          Grzegorz Borkowski added a comment - I see it was fixed, setting default value to 1.5. However, I'm not that sure if it's the best choice, so I reopen it again for discussion. I reported this issue in 2008. At that time it seemed to me to be the logical value. However, if we fix it in 2010, the most logical value is 1.6, I think. Java 5 was scheduled to end-of-live in 2009, if I remember correctly. Java 6 is stable and mature. Probably 99% of projects starting in year 2010 will use Java 6, so they will have to override this setting anyway. The sense of "default" value is that most of people will not have to change it. In this context, if everybody is going to change it to 1.6 anyway, than it has no sense at all. I've just checked the project I'm working on now. It has compiler level set to 1.6. Probably, two years ago when this issue was reported, it was 1.5. As the Java 7 is not that likely in the near future to come (I'm not the best informed guy on this topic, but that's the popular feeling I think), than using 1.6 as default value has a chance to be valid for several years.
          Hide
          Benjamin Bentmann added a comment -

          For the upcoming plugin release, it is 1.5/1.5, please open another issue for 1.6.

          Show
          Benjamin Bentmann added a comment - For the upcoming plugin release, it is 1.5/1.5, please open another issue for 1.6.
          Hide
          Grzegorz Borkowski added a comment -

          Well, I can do it, but I don't understand... you could change it to 1.5 from 1.3 after so many years, and now you can't modify this fix? what's the problem with this? And what's the point of releasing new version of plugin with default set to 1.5 after so many years, only to change it 1.6 soon?

          Show
          Grzegorz Borkowski added a comment - Well, I can do it, but I don't understand... you could change it to 1.5 from 1.3 after so many years, and now you can't modify this fix? what's the problem with this? And what's the point of releasing new version of plugin with default set to 1.5 after so many years, only to change it 1.6 soon?
          Hide
          redstun added a comment - - edited

          We can see here that soon after the request (to default to 1.5) was fixed, we got a new request to change it again. Over time, this will be endless.

          To really have this issue fixed, in a proper way, I've filed the all-in-one issue MCOMPILER-125, that Maven should follow Ant and Eclipse to default the source/target levels to the JDK being used.

          To express your opinion/idea, please see MCOMPILER-125 and comment there.

          Thanks

          Show
          redstun added a comment - - edited We can see here that soon after the request (to default to 1.5) was fixed, we got a new request to change it again. Over time, this will be endless. To really have this issue fixed, in a proper way, I've filed the all-in-one issue MCOMPILER-125 , that Maven should follow Ant and Eclipse to default the source/target levels to the JDK being used. To express your opinion/idea, please see MCOMPILER-125 and comment there. Thanks

            People

            • Assignee:
              Jason van Zyl
              Reporter:
              Grzegorz Borkowski
            • Votes:
              44 Vote for this issue
              Watchers:
              16 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: