1. 程式人生 > >springboot專案打完war包部署到tomcat報404

springboot專案打完war包部署到tomcat報404

首先如果是你部署的專案沒有問題的話 除錯訪問可以正常訪問的話 那麼我這篇文章能幫到你  尤其是第一次部署專案的新手

有的打包時候沒有指定打包的專案名字的話就是testtool0.0.1-SNAPSHO這樣的   想修改成自己定義的專案的名字的話

<build>
    <!-- 修改war包名稱    改成 你自己想要的專案的名字即可  訪問路徑就成了 http://localhost:8080/testtool/adinfo/index  - ->
    <finalName>testtool</finalName>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
        <plugin>
            <groupId>org.mybatis.generator</groupId>
            <artifactId>mybatis-generator-maven-plugin</artifactId>
            <version>1.3.2</version>
            <configuration>
                <verbose>true</verbose>
                <overwrite>true</overwrite>
            </configuration>
        </plugin>
    </plugins>
</build>