How to modify the version of web and jdk when eclipse creates a maven project

How to modify the version of web and jdk when eclipse creates a maven project

 

1. First find the org.eclipse.wst.common.project.facet.core.xml file under .settings under the project

2. Modify the files inside to the jdk and web versions we need

<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
  <fixed facet="wst.jsdt.web"/>
  <installed facet="java" version="1.8"/>
  <installed facet="jst.web" version="3.1"/>
  <installed facet="wst.jsdt.web" version="1.0"/>
</faceted-project>

3. Add the compilation plugin to the pom file of our maven project

  <build>
    <finalName>SSM</finalName>
    	<plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
  </build>

4. Update our maven project

Right click on our project name, Maven->Update Project...

  

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324887278&siteId=291194637