问题描述:
在使用IDEA进行maven项目开发时,使用内置Tomcat进行启动项目,但经常会出现端口占用情况
[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:start (default-cli) on project dmj-spider-web: Cannot invoke Tomcat manager:[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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command

原因分析:
这是Tomcat端口占用的表现,所以我们只需要在终端执行端口关闭命令即可
解决方案:
在终端输入命令(注意端口号,我是8088):lsof -i:8088

之后输入: kill -9 903 这里的903就是Tomcat在使用的pid

版权声明:本文为weixin_44422604原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。