maven工程的pom.xml
tomcat7配置:

生成的插件:

deploy啟動報錯:

詳細報錯資訊:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.554 s
[INFO] Finished at: 2017-07-01T12:41:00+08:00
[INFO] Final Memory: 17M/176M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:deploy (default-cli) on project shiro: Cannot invoke Tomcat manager: Connection refused: connect -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Process finished with exit code 1
附:專案的maven已經配置
另外用tomcat部署可以啟動。插件啟動就報錯。
=========綜上==========
求大神幫忙
uj5u.com熱心網友回復:
uj5u.com熱心網友回復:
<plugins><plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<path>/shiro</path>
<port>8080</port>
<uriEncoding>UTF-8</uriEncoding>
<url>http://localhost:8080/shiro</url>
<server>Tomcat7</server>
</configuration>
</plugin>
<!-- 編譯插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
我一般都是這樣寫的,你試試
uj5u.com熱心網友回復:
有沒有解決?我也遇到同樣的問題idea2019.1.3
jdk1.8
tomcat7
uj5u.com熱心網友回復:
各位!!!!!!!注意了!!!!!你們復制pom.xml檔案的時候, <artifactId>這個地方沒有修改</artifactId>
上放這個地方沒有修改,導致沖突,所以部署的不是檔案名這個專案!
uj5u.com熱心網友回復:
如果你想直接啟動,直接通過tomcat:run命令即可啟動;如果你需要在本地tomcat啟動,需要先啟動tomcat,并且配置相關權限
uj5u.com熱心網友回復:
老哥你解決了嗎,我遇到了同樣的問題:jdk1.8+tomcat7,運行tomcat7:run時報的錯,有帖子說是這倆不兼容,但是同一個專案我3月前還運行的好好的,不同的只是之前用的idea2019.3,現在用的2020.1.求大佬指點。
Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.1:run (default-cli) on project travel: Could not start Tomcat
uj5u.com熱心網友回復:
我出錯的原因是@WebServlet("registerServelt")路徑寫錯了,少加了一個 / ,專案就啟動不了了 (╯‵□′)╯︵┻━┻
uj5u.com熱心網友回復:
樓主,你哪個問題解決了嘛?解決了能指教一下嘛?我qq是646842195,謝了!!!uj5u.com熱心網友回復:
同問,無法解決,樓主,我qq495624824,解決了的話能指導一下嗎?轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/20897.html
標籤:Web 開發
