Maven - 在当前项目中找不到前缀'tomcat7'的插件

 知足者常乐-----仙_230 发布于 2023-02-04 13:05

我用原型"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
 


我不明白为什么它不起作用.

你有什么解决办法 ?

谢谢

1 个回答
  • 我知道一年前有人问过,但我的回答可能对我以外的人有用.

    如果在pom.xml文件中创建构建标记不起作用,请尝试settings.xml以这种方式编辑.m2目录中的文件:

    <pluginGroups>
      ...
      <pluginGroup>org.apache.tomcat.maven</pluginGroup>
      ...
    </pluginGroups>
    

    我在这里找到了解决方案:http: //tomcat.apache.org/maven-plugin-2.2/

    2023-02-04 13:08 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有