我尝试做run-as - > mvn在eclipse中安装,但后来我收到错误但我不知道如何解决它。
这是错误:
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>
答案 0 :(得分:1)
对于遇到同样问题的其他人,我可以通过回退到Maven 3.0.x版来解决问题。因为我的项目还没有为版本3.1.x做好准备。
答案 1 :(得分: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
您可以尝试再次运行该命令吗?
答案 2 :(得分:0)
可能已经解决了这个问题,但其他人都尝试将maven-shade-plugin更新为2.1。您可以通过编辑pom.xml来完成此操作。