Intellij Idea's MAVEN project will become JDK 1.5 on the right-click menu maven Reimport

Source: Internet
Author: User

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:

    1. Add the above build parameter to the total pom.xml.
    2. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.