Maven Web配置


在idea中发现运行tomcat7:run命令后,显示以下错误,表明没有找到tomcat插件。
遇到 no plugin found for prefix ‘tomcat 7’ in the current project and in the plugin groups 的解决办法
这个时候找到maven conf的setting.xml文件,在插件标签中加入这段代码。

<pluginGroups>
<pluginGroup>org.apache.tomcat.maven</pluginGroup>
</pluginGroups>
完成后,重新运行tomcat7:run即可。

其余两个方法,未尝试,仅供参考。
pom.xml文件中加入下列代码。

<pluginRepositories>
    <pluginRepository>
        <id>apache.snapshots</id>
        <name>Apache Snapshots</name>
        <url>http://repository.apache.org/content/groups/snapshots-group/</url>
        <releases>
            <enabled>false</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </pluginRepository>
</pluginRepositories>


加入tomcat7配置

<plugin>
    <groupId>org.apache.tomcat.maven</groupId>
    <artifactId>tomcat7-maven-plugin</artifactId>
    <version>2.2</version>
</plugin>

评论
  目录