您的位置首页百科问答

如何解决No plugin found for prefix 'tomcat7'

如何解决No plugin found for prefix 'tomcat7'

的有关信息介绍如下:

如何解决No plugin found for prefix 'tomcat7'

在用eclipse热布署web项目时可能会报如下错误:

错误类型一:

_hkscs[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 2.720 s

[INFO] Finished at: 2017-07-12T22:29:42+08:00

[INFO] Final Memory: 13M/155M

[INFO] ------------------------------------------------------------------------

[ERROR] No plugin found for prefix 'tomcat7' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\yc\.m2\repository), central (https://repo.maven.apache.org/maven2)] -> [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:

选中项目,按图所示选中Maven Build...

在Goals中输入命令tomcat7:deploy

运行时出现如下错误提示

上面错误是由于eclipse项目中没有配置tomcat-maven-plugin插件引起的,可以在项目的pom文件中引入如下代码:

org.apache.tomcat.maven

tomcat7-maven-plugin

2.2

上面配置中的tomcat7-maven-plugin同样适用于tomcat7.x, tomcat8.x, tomcat8.x

配置完tomcat7-maven-plugin插件后再次执行上面操作,可以看到错误消失了。