Maven阻止下载jar(artifactId:tomcat-maven-plugin)

时间:2012-07-03 08:16:43

标签: maven maven-tomcat-plugin

我遇到tomcat-maven-plugin的问题: 这是代码

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>tomcat-maven-plugin</artifactId>
    <version>1.0-beta-1</version>
</plugin>

所以运行此命令后:clean tomcat:run

我得到了这个结果:

 [INFO] Scanning for projects...
 [INFO]                                                                          
 [INFO] ------------------------------------------------------------------------
 [INFO] Building seleniumproject Maven Webapp 0.0.1-SNAPSHOT
 [INFO] ------------------------------------------------------------------------
 [INFO] 
 [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ seleniumproject ---
 [INFO] Deleting C:\Users\Amira\junoWorkspace\seleniumproject\target
 [INFO] 
 [INFO] >>> tomcat-maven-plugin:1.0-beta-1:run (default-cli) @ seleniumproject >>>
 [INFO] 
 [INFO] --- maven-resources-plugin:2.5:resources (default-resources)  @seleniumproject ---
 [debug] execute contextualize
 [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
 [INFO] Copying 0 resource
 [INFO] 
 [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @  seleniumproject ---
 [INFO] No sources to compile
 [INFO] 
 [INFO] <<< tomcat-maven-plugin:1.0-beta-1:run (default-cli) @ seleniumproject <<<
 [INFO] 
 [INFO] --- tomcat-maven-plugin:1.0-beta-1:run (default-cli) @ seleniumproject ---


 Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-  api/2.0/maven-plugin-api-2.0.pom
 Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0/maven-plugin-api-2.0.pom (601 B at 1.2 KB/sec)
 Downloading: http://repo.maven.apache.org/maven2/junit/junit/3.8.2/junit-3.8.2.pom
 .......................................
 Downloaded: http://repo.maven.apache.org/maven2/org/apache/tomcat/dbcp/6.0.16/dbcp-6.0.16.jar (194 KB at 128.6 KB/sec)

 Downloaded: http://repo.maven.apache.org/maven2/org/apache/tomcat/coyote/6.0.16/coyote-6.0.16.jar (725 KB at 367.5 KB/sec)

正如您所看到的那样阻止下载: 请问是否有解决方案

1 个答案:

答案 0 :(得分:1)

我不知道你从哪里获得网址:

http://repo.maven.apache.org/maven2/

但它看起来你已经更改了settings.xml文件中的配置,导致Maven Central改为http://repo1.maven.apache.org/maven2/。此外,我可以建议使用存储库管理器(Nexus,Archiva,Artifactory)。

BTW:你为什么使用mojo.codehaus tomcat插件而不是Apache http://tomcat.apache.org/maven-plugin.html的官方