Eugen Martynov Eugen Martynov - 9 months ago 36
Java Question

Handle different language and target levels for sources and tests with IntelliJ IDEA

I'm interested if someone has clue how to handle this pom in projects properties of IDEA:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.3</source>
<target>1.3</target>
<testSource>1.5</testSource>
<testTarget>1.5</testTarget>
</configuration>
<version>3.0</version>
</plugin>


Should I set project level 1.3 and module level 1.5 or wise verse around?

As well anytime when IDEA reloads maven project it sets language levels as it thinks from maven to 1.3 and after always complaints about test classes.

But this will go as bug report to JetBrains.

Answer Source

Supporting test source/target levels is tracked by this request. Language level changed message is also a known issue.