No plugin found for prefix ‘tomcat7’ in the current project and in the plugin groups

idea中开发javaweb应用,使用mvn tomcat7:run命令运行应用时,需要配置tomcat的maven插件。在没有配置的情况下会出现下面的错误提示。
[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\Administrator.m2\repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
添加tomcat的maven插件配置即可。

   <plugin>
        <groupId>org.apache.tomcat.maven</groupId>
        <artifactId>tomcat7-maven-plugin</artifactId>
        <version>2.2</version>
        <configuration>
            <path>/${project.artifactId}</path>
        </configuration>
    </plugin>

不过要注意的是,就算配置正确,若web应用的工作目录(Working directory)配置错误的话,还是会存在这个错误。
还有一点需要补充说明一下,不管机器中安装的tomcat版本是7还是8,都可以使用这个插件来运行应用。使用这种方法,不仅修改的jsp可以立即生效,也可以实现类的热部署,还可以使用断点调试。强大的idea。

  • 4
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值