Simplify java version configuration by using project-level property
-------------------------------------------------------------------

                 Key: MCOMPILER-84
                 URL: http://jira.codehaus.org/browse/MCOMPILER-84
             Project: Maven 2.x Compiler Plugin
          Issue Type: Improvement
            Reporter: Grzegorz Borkowski


I hate the fact that in each project I have to redefine the java source level 
for maven compiler, from 1.3 to 1.5. Using 1.3 as default in this  day and age 
simply doesn't make sense. I reported issue MCOMPILER-80 about it already. 
In the meantime, I have some more backword-compatible proposition: change maven 
compiler to check for some project-level property, if this property is set, it 
is used for java source and target level.
We nee to decide on property name, it can be called "java.version" or similar 
("javaVersion" ?). 
When it is implemented, specifying java version would be much simplified:
Instead of:

<build>
<plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
</build>

We would have:

<properties>
   <java.version>1.5</java.version>
</properties>

Much simpler and easier to remember!

BTW. I believe that java version level is really a part of project metadata, 
not simply some plugin metadata. So in best case it should be made a part of 
POM definition, just like <artifactId>, <version>, <name>, <packaging> itp. But 
it requires new XML schema for pom.xml, so it is candidate for next version of 
maven. Using property doesn't require any change to XML schema, so it may be 
implemented without waiting for new version of maven.

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

        

Reply via email to