You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2013/06/18 16:57:20 UTC

[jira] [Created] (MPOM-44) Compiler version settings cannot be overridden by defining maven.compiler.source/target

Sebb created MPOM-44:
------------------------

             Summary: Compiler version settings cannot be overridden by defining maven.compiler.source/target
                 Key: MPOM-44
                 URL: https://issues.apache.org/jira/browse/MPOM-44
             Project: Maven POMs
          Issue Type: Bug
          Components: maven-plugins
    Affects Versions: ASF-13
            Reporter: Sebb


The compiler plugin by default picks up the source and target from the properties
maven.compiler.source and maven.compiler.target.

Unfortunately, the Apache POM uses the following fixed values to specify the version:

{code}
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>2.5.1</version>
          <configuration>
            <source>1.4</source>
            <target>1.4</target>
          </configuration>

{code}

This means that child poms which use the properties expecting them to be honoured have to override the configuration as follows:

{code}
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-compiler-plugin</artifactId>
  <configuration>
    <source>${maven.compile.source}</source>
    <target>${maven.compile.target}</target>
  </configuration>
</plugin>
{code}

This is unnecessary and wrong.

For compatibility, the Apache Pom does need to still specify the default source/target as 1.4 (the plugin default is 1.5), but it should do so by using the standard properties which can then be overridden.

In fact, if the properties are defined, the compiler plugin config could be dropped, as it is the default behaviour.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira