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]