使用内置tomcat的pom配置

<build>标签里面添加

<resources>
    <resource>
        <directory>src/main/resources</directory>
        <includes>
            <include>**/*.xml</include>
            <include>**/*.properties</include>
            <include>**/*.md</include>
        </includes>
        <filtering>false</filtering>
    </resource>
</resources>
<plugins>
    <plugin>
        <groupId>org.apache.tomcat.maven</groupId>
        <artifactId>tomcat7-maven-plugin</artifactId>
        <version>2.2</version>
        <configuration>
            <port>80</port>
            <path>/</path>
            <uriEncoding>UTF-8</uriEncoding>
            <server>tomcat7</server>
        </configuration>
    </plugin>
</plugins>

Tomcat9

<!-- https://mvnrepository.com/artifact/org.opoo.maven/tomcat9-maven-plugin -->
<dependency>
    <groupId>org.opoo.maven</groupId>
    <artifactId>tomcat9-maven-plugin</artifactId>
    <version>3.0.0</version>
</dependency>
posted @ 2021-06-07 11:34  林宇风  阅读(697)  评论(0编辑  收藏  举报