5
Problem:
When I create a project maven
the project always got the version JDK 1.5
, change the JDK version in the IDE when doing a Maven > Project Update
he goes back to JDK 1.5
.
The archive setting.xml
is the place where I define the version of all Maven projects? If not where do for all new projects always use the version JDK 1.7
for example.
Observing: found a way to solve the problem using the file pom.xml
.
Code:
<!-- CONFIGURAR VERSÃO DO JAVA PARA 1.7 -->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
Advantage and Disadvantage
I understand that the head start of this code is that each Maven project can work with a specified Java version. A downside this code is for each new project I have to change the pom.xml
.
Thanks for the clarification, I thought it would have a universal form and that the file
setting.xml
existed for it. I am happy to know that other programmers use this method and that have a way to use the samepom.xml
for N projects.– noNihongo