⭐I have met the following problem several times, and dealt with it over and over...
⭐Until today, I found out where the problem is, but can't solve it~
Module 'xxx' is imported from Maven. Any changes made in its configuration may be lost after reimporting
⭐As the picture shows, once I reimport All Maven projects, its version will change to 13 from 8...
⭐After reimporting, it comes back:
I would appreciate it very grateful if you can assist me..
CodePudding user response:
add the following codes in the pom.xml of your project:
<build>
<plugins>
<!-- ensure jdk 1.8-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
configure both <source>
and <target>
to 1.8(it's up to you).
reason: you have never set the jdk version. so every time you modify the pom.xml and reimport the dependencies, it will revert to the default JDK 13.