I have this plugin configured in parent pom
<properties>
<java.version>1.7</java.version>
<maven-compiler-plugin.version>3.3</maven-compiler-plugin.version>
</properties>
...
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<compilerArgument>-XDignore.symbol.file</compilerArgument>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
And this in the child
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
</plugins>
</build>
When i run maven update project on both projects , i expect that child change JRE to 1.7, but it doesn't, i and i cannot figure it out why. If i put the configuration in the child then it works... Do you know what am i doing wrong?
I was having the same issue in my build process. The build was failing with the following error:
and the reason was due to the compilation of test files not having the correct java level set. The following configuration worked for me:
In the parent:
In the child: