[ 
https://issues.apache.org/jira/browse/MCOMPILER-254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Scholte updated MCOMPILER-254:
-------------------------------------
    Description: 
Maven 3.3 enhanced the support for toolchains (by allowing toolchains.xml in 
the $\{M2}/conf/ directory). The compiler plugin already uses the toolchains to 
determine the jdk home.

Unfortunately, it still requires setting -source and -target. So I still have 3 
places to set the jdk version of my source code.

The following pom.xml snippet currently sets the jdk home to 1.8, but uses 1.5 
flags for source and target.

I simply request that the snippet sets source and target to 1.8 (or doesn't set 
them at all when a toolchain is used).
{code:xml}
        <build>
                <plugins>
                        <plugin>
                           <groupId>org.apache.maven.plugins</groupId>
                           <artifactId>maven-toolchains-plugin</artifactId>
                           <version>1.1</version>
                           <executions>
                              <execution>
                                 <goals>
                                    <goal>toolchain</goal>
                                 </goals>
                              </execution>
                           </executions>
                           <configuration>
                               <toolchains>
                                  <jdk>
                                      <version>1.8</version>
                                  </jdk>
                                </toolchains>
                          </configuration>
                        </plugin>
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-compiler-plugin</artifactId>
                        </plugin>
                </plugins>
        </build>
{code}

  was:
Maven 3.3 enhanced the support for toolchains (by allowing toolchains.xml in 
the ${M2}/conf/ directory). The compiler plugin already uses the toolchains to 
determine the jdk home.

Unfortunately, it still requires setting -source and -target. So I still have 3 
places to set the jdk version of my source code.

The following pom.xml snippet currently sets the jdk home to 1.8, but uses 1.5 
flags for source and target.

I simply request that the snippet sets source and target to 1.8 (or doesn't set 
them at all when a toolchain is used).
{code:xml}
        <build>
                <plugins>
                        <plugin>
                           <groupId>org.apache.maven.plugins</groupId>
                           <artifactId>maven-toolchains-plugin</artifactId>
                           <version>1.1</version>
                           <executions>
                              <execution>
                                 <goals>
                                    <goal>toolchain</goal>
                                 </goals>
                              </execution>
                           </executions>
                           <configuration>
                               <toolchains>
                                  <jdk>
                                      <version>1.8</version>
                                  </jdk>
                                </toolchains>
                          </configuration>
                        </plugin>
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-compiler-plugin</artifactId>
                        </plugin>
                </plugins>
        </build>
{code}


> Do not ignore toolchains to set -source and -target
> ---------------------------------------------------
>
>                 Key: MCOMPILER-254
>                 URL: https://issues.apache.org/jira/browse/MCOMPILER-254
>             Project: Maven Compiler Plugin
>          Issue Type: Improvement
>    Affects Versions: 3.1, 3.2, 3.3
>         Environment: Maven 3.3
>            Reporter: Robert Schaft
>              Labels: toolchains
>
> Maven 3.3 enhanced the support for toolchains (by allowing toolchains.xml in 
> the $\{M2}/conf/ directory). The compiler plugin already uses the toolchains 
> to determine the jdk home.
> Unfortunately, it still requires setting -source and -target. So I still have 
> 3 places to set the jdk version of my source code.
> The following pom.xml snippet currently sets the jdk home to 1.8, but uses 
> 1.5 flags for source and target.
> I simply request that the snippet sets source and target to 1.8 (or doesn't 
> set them at all when a toolchain is used).
> {code:xml}
>       <build>
>               <plugins>
>                       <plugin>
>                          <groupId>org.apache.maven.plugins</groupId>
>                          <artifactId>maven-toolchains-plugin</artifactId>
>                          <version>1.1</version>
>                          <executions>
>                             <execution>
>                                <goals>
>                                   <goal>toolchain</goal>
>                                </goals>
>                             </execution>
>                          </executions>
>                          <configuration>
>                              <toolchains>
>                                 <jdk>
>                                     <version>1.8</version>
>                                 </jdk>
>                               </toolchains>
>                         </configuration>
>                       </plugin>
>                       <plugin>
>                               <groupId>org.apache.maven.plugins</groupId>
>                               <artifactId>maven-compiler-plugin</artifactId>
>                       </plugin>
>               </plugins>
>       </build>
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to