我用原型"webapp"创建了一个Maven项目但是当我启动命令"mvn tomcat7:start"时,我出现以下错误:
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:\dark\.m2\repository), central (http://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.
我的项目结构:
-src -main -resources -webapp -WEB-INF -web.xml -index.jsp -target -classes -dependency - // the 'dependency' directory contains all the jar files -lbagno -maven-archiver -surefire lbagno.war
我的pom.xml包含了tomcat的依赖.
的pom.xml
4.0.0 com.myspace lbagno war 0.0.1-SNAPSHOT lbagno Maven Webapp http://maven.apache.org junit junit 3.8.1 test org.springframework spring-core 3.1.0.RELEASE org.apache.tomcat.maven tomcat7-maven-plugin 2.2 maven-plugin lbagno
我不明白为什么它不起作用.
你有什么解决办法 ?
谢谢
我知道一年前有人问过,但我的回答可能对我以外的人有用.
如果在pom.xml
文件中创建构建标记不起作用,请尝试settings.xml
以这种方式编辑.m2目录中的文件:
<pluginGroups> ... <pluginGroup>org.apache.tomcat.maven</pluginGroup> ... </pluginGroups>
我在这里找到了解决方案:http: //tomcat.apache.org/maven-plugin-2.2/