我想使用 maven 将 web-app 部署到 tomcat。但是我遇到了无法下载 tomcat maven 插件的错误。
我的 pom.xml 的一部分
<build>
<finalName>cdmi-server</finalName>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<!--<artifactId>maven-compiler-plugin</artifactId>-->
<version>2.0.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<url>http://127.0.0.1:8080/manager</url>
<server>TomcatServer</server>
<path>/cdmi-server</path>
</configuration>
</plugin>
</plugins>
</build>
...
<pluginRepositories>
<pluginRepository>
<id>maven2-repository.dev.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2/</url>
<layout>default</layout>
</pluginRepository>
<pluginRepository>
<id>maven-repository.dev.java.net</id>
<name>Java.net Maven 1 Repository (legacy)</name>
<url>http://download.java.net/maven/1</url>
<layout>legacy</layout>
</pluginRepository>
</pluginRepositories>
<repositories>
<repository>
<id>m1.dev.java.net</id>
<url>http://download.java.net/maven/1</url>
<layout>legacy</layout>
</repository>
<repository>
<id>m2.dev.java.net</id>
<url>http://download.java.net/maven/2</url>
<layout>default</layout>
</repository>
</repositories>
tomcat-users.xml:
<role rolename="manager"/>
<role rolename="admin"/>
<user username="admin" password="password" roles="admin,manager"/>
设置.xml(行家):
<servers>
<server>
<id>TomcatServer</id>
<username>admin</username>
<password>password</password>
</server>
</servers>
我得到的错误,当我运行 mvn:install 时,
Project ID: org.codehaus.mojo:tomcat-maven-plugin
Reason: POM 'org.codehaus.mojo:tomcat-maven-plugin' not found in repository: Unable to download the artifact from any repository
org.codehaus.mojo:tomcat-maven-plugin:pom:2.0.2
from the specified remote repositories:
m2.dev.java.net (http://download.java.net/maven/2),
central (http://repo1.maven.org/maven2),
maven2-repository.dev.java.net (http://download.java.net/maven/2/),
maven-repository.dev.java.net (http://download.java.net/maven/1),
m1.dev.java.net (http://download.java.net/maven/1)
for project org.codehaus.mojo:tomcat-maven-plugin
如何解决错误?