maven-webapp

1.创建maven-archetype-webapp

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
run后弹出浏览器窗口:
在这里插入图片描述

2.添加编译插件和web.xml的版本

pom.xml

    <build>
        <plugins>
            <!--编译插件-->
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <!--插件的版本-->
                <version>3.8.0</version>
                <!--编译级别-->
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <!--编码格式-->
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
        </plugins>
    </build>

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
		  http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
           version="3.0">

</web-app>

猜你喜欢

转载自blog.csdn.net/dl674756321/article/details/89600363