使用Maven tomcat:run命令啓動web項目時修改默認端口,清除運行Maven build...後積累的配置項

使用Maven tomcat:run命令啓動web項目時修改默認端口

<!-- 配置tomcat插件 -->
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <port>8181</port>
                    <path>/</path>
                    <uriEncoding>UTF-8</uriEncoding>
                </configuration>
            </plugin>
        </plugins>
    </build>

可是這樣的修改方法 並不起作用
Goals值中的tomcat:run前邊加上-Dmaven.tomcat.port=8181即可
-Dmaven.tomcat.port=8181
或者:

tomcat:run -Dmaven.tomcat.uriEncoding=UTF-8 -Dmaven.tomcat.path=/ -Dmaven.tomcat.port=8181

eclipse清除運行Maven build…後積累的配置項

清理配置項同樣在 Run As —> Run configurations…中。

這裏寫圖片描述
這裏寫圖片描述這裏寫圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章