简体   繁体   中英

Mvn install error in eclipse

I try to do run-as -> mvn install in eclipse, but then i get an error but i dont know how to solve it.

This is the error:

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]

My pom looks like this:

<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>

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.

Looks like an internet connection issue to me:

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

What happens if you repeat the command? The file should be available on the central repo: http://search.maven.org/#artifactdetails%7Corg.apache.commons%7Ccommons-parent%7C3%7Cpom

Can you try to run the command again?

Probably already solved this, but everyone else, try updating maven-shade-plugin to 2.1. You can do so by editing pom.xml.

Found this solution here: https://issues.apache.org/jira/browse/CAMEL-6587

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM