一开始在项目中导入tomcat插件的坐标
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.1</version>
<configuration>
<port>9001</port>
<path>/</path>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<port>9001</port>
<uriEncoding>UTF-8</uriEncoding>
<server>tomcat7</server>
<path>/</path>
</configuration>
</plugin>
</plugins>
</build>
执行tomcat7:run,一直说找不到插件依赖的jar包,我就手动拷贝到本地仓库中.
接下来再执行,又报如下这个错
No plugin found for prefix 'tomcat7' in the current project
更换阿里云镜像
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
先执行tomcat7:deploy
再执行tomcat7:run
成功运行