Maven – source value 1.5 is obsolete and will be removed in a future release
In IntelliJ IDEA, Maven builds a project, and hits the following warning message?
Warning:java: source value 1.5 is obsolete and will be removed in a future release
Warning:java: target value 1.5 is obsolete and will be removed in a future release
To fix it, add maven-compiler-plugin
plugin.
pom.xml
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
That post doesn’t explain why the warning is shown and what the fix is doing.
The warning appear when the default configuration of the maven-compiler-plugin is used and the project is using another version of java.
To fix it, you have to specify the version of java you are using, with the parameters you mentioned (source and target)
Thanks for your explanation 🙂
Thank’s for help!
You can also resolve this problem by using below steps for Eclips user and can be work for IntelliJ as well-
I fix this issue by setting Project language level to 8 in File → Project Structure → Project → Project language level, and same in File → Settings → Build, Execution, Deployment, Compiler → Java Compiler → Target bytecode version.
Thanks a lot man.