How to configure compiler level (1.6) in maven set

2019-05-21 12:39发布

问题:

I am familiar with configuring maven-compiler-plugin to use java 1.6 in pom.xml and using parent pom file.

Is there a way to configure java compiler level to java 1.6 in the settings.xml level (so that all my maven projects will use java 1.6)?

In this thread default maven compiler setting somebody told there is a way to configure it in settings.xml. Can someone please explain how to configure?

PS: Another way to specify Java compiler level:

<properties>
       <maven.compiler.source>1.6</maven.compiler.source>
       <maven.compiler.target>1.6</maven.compiler.target>
</properties>

-Siva

回答1:

Simple answer No. In the settings file you don't configure things like this, cause it doesn't make sense and would make your builds not reproducible. The information about configuring the compiler plugin in settings.xml is rubbish.



标签: java maven-3