1

我有一个使用 1.1 版 tomcat maven 插件的完整项目。我试图切换到最后一个 maven tomcat 插件版本,在pom.xml

<plugin>
            <groupId>org.apache.tomcat.maven</groupId>
            <artifactId>tomcat7-maven-plugin</artifactId>
            <configuration>
                <contextFile>src/main/webapp/META-INF/context.xml</contextFile>
            </configuration>
            <dependencies>      
                <dependency>
                    <groupId>mysql</groupId>
                    <artifactId>mysql-connector-java</artifactId>
                    <version>5.1.9</version>
                </dependency>
            </dependencies>
        </plugin>   

但是,使用tomcat7:run而不是tomcat:run我启动项目会收到以下错误:

[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building group-organizer-server 1.0.0-BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> tomcat7-maven-plugin:2.0:run (default-cli) @ group-organizer-server >>>
[INFO] 
[INFO] --- aspectj-maven-plugin:1.2:compile (default) @ group-organizer-server ---
[INFO] 
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ group-organizer-server ---
[debug] execute contextualize
[WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource 
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ group-organizer-server ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] <<< tomcat7-maven-plugin:2.0:run (default-cli) @ group-organizer-server <<<
[INFO] 
[INFO] --- tomcat7-maven-plugin:2.0:run (default-cli) @ group-organizer-server ---
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/10/maven-parent-10.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:03.805s
[INFO] Finished at: Mon Nov 05 18:18:32 CET 2012
[INFO] Final Memory: 7M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.0:run (default-cli) on project group-organizer-server: Execution default-cli of goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.0:run failed: Plugin org.apache.tomcat.maven:tomcat7-maven-plugin:2.0 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.tomcat.maven:tomcat7-maven-plugin:jar:2.0 (): Failed to read artifact descriptor for org.apache.maven.doxia:doxia-sink-api:jar:1.0: Could not transfer artifact org.apache.maven:maven-parent:pom:10 from/to central (http://repo.maven.apache.org/maven2): No response received after 60000 -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1]     http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

我怎样才能解决这个问题?

4

1 回答 1

1

昨天看起来 maven central 有一些问题。所以用 -U 再试一次

于 2012-11-06T11:06:22.013 回答