A related issue
Intellij idea Error:java:Compilation failed:internal Java compiler Error
http://bbs.vpigirl.com/forum.php?mod=viewthread&tid=793&fromuid=2
(Source: The way of the change of memories, time has become very slow!) )
Problem phenomenon
Intellij Idea's MAVEN project will become JDK 1.5 on the right-click menu maven Reimport
Problem analysis
The MAVEN project is divided into multiple moudle, one is WebApp, and the other is for WebApp services.
Each time you modify Pom.xml, you will see the language level of the project: it becomes 1.5, but WebApp has not changed, or 1.7.
After analyzing all the pom.xml of the entire project, it was found that only the WebApp module had compile parameters, as follows:
<build> <finalname>Elasticsearch</finalname> <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> <encoding>UTF-8</encoding> </configuration> </plugin>Other compilation plugins</plugins> </Build>
None of the others, so the others become jdk1.5, which is the default value of Maven.
Solution Solutions
Modification Method:
- Add the above build parameter to the total pom.xml.
- Add the following in the pom.xml of the other modules.
<parent> <artifactId>tqmall-elasticsearch</artifactId> <groupId>com.tqmall.elasticsearch</groupId> <version>1.0-SNAPSHOT</version> </parent>
This way, after the next Maven–>reimport language level is 1.7 instead of 1.5.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Intellij Idea's MAVEN project will become JDK 1.5 on the right-click menu maven Reimport