1

我尝试在 Eclipse 中执行 run-as -> mvn install,但随后出现错误,但我不知道如何解决。

这是错误:

Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:2.0:shade (default) on project reminder: Execution default of goal org.apache.maven.plugins:maven-shade-plugin:2.0:shade failed: Plugin org.apache.maven.plugins:maven-shade-plugin:2.0 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-shade-plugin:jar:2.0 (): Failed to read artifact descriptor for commons-io:commons-io:jar:1.3.2: Could not transfer artifact org.apache.commons:commons-parent:pom:3 from/to central (http://repo.maven.apache.org/maven2): No response received after 60000 -> [Help 1]

我的 pom 看起来像这样:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>mednanny</groupId>
  <artifactId>reminder</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <name>Reminder</name>  
    <dependencies>           
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.24</version>
        </dependency>
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4.6</version>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>
        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>1.4</version>
        </dependency> 
    </dependencies>
    <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>2.0</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <transformers>
                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                  <mainClass>Reminder.ReminderErinnerungJob</mainClass>
                </transformer>
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
4

3 回答 3

1

For other folks who are facing same issue, mine got resolved by falling back to Maven version 3.0.x. Coz my project was not ready for the version 3.1.x.

于 2014-02-13T06:52:15.993 回答
0

对我来说似乎是互联网连接问题:

Could not transfer artifact org.apache.commons:commons-parent:pom:3 
from/to central (http://repo.maven.apache.org/maven2): 
No response received after 60000

如果你重复这个命令会发生什么?该文件应该在中央仓库中可用:http ://search.maven.org/#artifactdetails%7Corg.apache.commons%7Ccommons-parent%7C3%7Cpom

您可以尝试再次运行该命令吗?

于 2013-03-22T15:50:14.510 回答
0

可能已经解决了这个问题,但是其他人,尝试将 maven-shade-plugin 更新到 2.1。您可以通过编辑 pom.xml 来做到这一点。

在这里找到了这个解决方案:https ://issues.apache.org/jira/browse/CAMEL-6587

于 2013-11-07T09:28:52.893 回答