IntelliJ ignores maven.compiler.target property
Answered
Hello,
I am testing a bit and wanted to use Java 8 instead of 5, so I added the maven.compiler.target and maven.compiler.source properties to the pom.xml:
<properties>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
</properties>
But for some reason it still fails. When I try to use IntStream it fails with an message that it is available since 1.8.
It works when I set the maven-compiler-plugin with the versions:
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
According to https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html this should work.
Why is that so?
Thanks.
Please sign in to leave a comment.
Please see http://stackoverflow.com/a/12900859/104891.
If the issue persists, file a bug at https://youtrack.jetbrains.com/issues/IDEA and attach a sample project to reproduce.
That actually worked. I thought the IDE would read it from the pom.xml.