Eclipse creates the Maven Java8 Web project and deploys the Tomcat__java directly

Source: Internet
Author: User

(1) Remove the tick of dynamic WEB module first
(2) Change the Java version to 1.8, click Apply
(3) Check the dynamic Web Module again, click Apply
(4) Click the further configuration available that appears below to set

Click on the right runtimes to select Tomcat installed on this computer

Click the Apply and Close button to save the settings

The error is due to the SERVELT-API can not be found, edit pom.xml

<project xmlns= "http://maven.apache.org/POM/4.0.0" xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance" xsi:s chemalocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" > <modelversion >4.0.0</modelVersion> <groupId>com.cntaiping.tpa</groupId> <artifactid>es</ artifactid> <packaging>war</packaging> <version>0.0.1-SNAPSHOT</version> &LT;NAME&G T;es Maven webapp</name> <url>http://maven.apache.org</url> <properties> <proje Ct.build.sourceencoding>utf-8</project.build.sourceencoding> <maven.compiler.source>1.8</
    Maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> </properties> <dependencies> <!--Https://mvnrepository.com/artifact/mysql/mysql-connector-java--> < Dependency> <groupid>mysql&Lt;/groupid> <artifactId>mysql-connector-java</artifactId> <version>5.1.5< /version> </dependency> <!--https://mvnrepository.com/artifact/javax.servlet/javax.servlet-ap I--> <dependency> <groupId>javax.servlet</groupId> <artifactid&gt ;javax.servlet-api</artifactid> <version>3.1.0</version> &LT;SCOPE&GT;PROVIDED&L
            t;/scope> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.9</version> <scope> test</scope> </dependency> </dependencies> <build> <finalName>es<
 /finalname> </build> </project>

Note: This is not the standard structure for the default MAVEN project, we need to change

Right-click the item and select New–>source Folder

Enter Src/main/java at Folder name, click Finish button

Related Article

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.