Hello,

Yes, I could use "maven.compiler.source"  properties, but i'm on a parent
pom, and if somebody add a configuration like

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <source>xxx</source>
                    <target>xxx</target>
                </configuration>
            </plugin>

on his module it will fail.

I was wondering if there was some kind of auto-link between source level in
maven-compiler-plugin and toolchain plugin (it would be nice)

Anyway, I will go with this solution and hope for the best (anyway I will
set the default jdk version to 1.5 so that if somebody update the source
level by itself (not by the maven.compiler.source if will fail hard :D )

2015-04-22 20:56 GMT+02:00 Ron Wheeler <[email protected]>:

> Would setting a property ( <java_compliance_version>1.6
> </java_compliance_version>) in your parent and using the property as the
> value (<source>$java_compliance_version</source> )in the source, work?
>
> Ron
>
>
>
> On 22/04/2015 2:42 PM, intel radoux wrote:
>
>> Hello,
>>
>> I wish to set something like this in my parent pom :
>>
>>             <plugin>
>>                  <groupId>org.apache.maven.plugins</groupId>
>>                  <artifactId>maven-compiler-plugin</artifactId>
>>                  <version>3.3</version>
>>                  <configuration>
>>                      <source>1.6</source>
>>                      <target>1.6</target>
>>                  </configuration>
>>              </plugin>
>>              <plugin>
>>                  <groupId>org.apache.maven.plugins</groupId>
>>                  <artifactId>maven-toolchains-plugin</artifactId>
>>                  <version>1.1</version>
>>                  <configuration>
>>                      <toolchains>
>>                          <jdk>
>>
>>
>> <version>${project.build.pluginsAsMap(org.apache.maven.plugins:maven-compiler-plugin).configuration.children[0].value}</version>
>>
>>                          </jdk>
>>                      </toolchains>
>>                  </configuration>
>>                  <executions>
>>                      <execution>
>>                          <goals>
>>                              <goal>toolchain</goal>
>>                          </goals>
>>                      </execution>
>>                  </executions>
>>              </plugin>
>>
>> so that I can only set the source level in one place. The idea is that I
>> can set another level in one child module and toolchain will select the
>> correct JDK.
>>               <plugin>
>>                  <groupId>org.apache.maven.plugins</groupId>
>>                  <artifactId>maven-compiler-plugin</artifactId>
>>                  <version>3.3</version>
>>                  <configuration>
>>                      <source>1.7</source>
>>                      <target>1.7</target>
>>                  </configuration>
>>              </plugin>
>>
>> unfortunatly this don't work has ${project.build....... } is not resolved
>> when set in configuration element.
>> Do somebody have another idea on how to set this ? (why toolchain doesn't
>> work hand on hand with compiler plugins ? )
>>
>> Thank you
>>
>>
>
> --
> Ron Wheeler
> President
> Artifact Software Inc
> email: [email protected]
> skype: ronaldmwheeler
> phone: 866-970-2435, ext 102
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to