我有以下依赖关系:
<dependency>
<groupId>ant</groupId>
<artifactId>ant</artifactId>
<version>1.6.5-osgi</version>
</dependency>
它在maven中央存储库中不可用。 我可以选择哪个镜像来正确解析它(在本地安装并部署到我们的内部存储库)?
UPDATE 我从答案中看到我需要添加一些细节。 我们的任何poms中都没有明确设置此依赖关系。当调用maven安装时,它发生故障导致无法找到它。我发布完整的堆栈:
[ERROR] Failed to execute goal on project XXXXXX-functional-test: Could not resolve
dependencies for project XXXXXX-functional-test:jar:2.16.1: Failed to collect dependencies
for [org.codehaus.groovy:groovy-all:jar:1.7.2 (test), sahi:sahi:jar:3.5 (test),
org.easyb:easyb-core:jar:1.1 (test), org.apache.httpcomponents:httpclient:jar:4.1.1 (test),
commons-io:commons-io:jar:1.4 (test), org.aspectj:aspectjrt:jar:1.6.8 (compile),
org.springframework.integration:spring-integration-sftp:jar:2.0.5.RELEASE (compile),
org.springframework.integration:spring-integration-core:jar:2.0.5.RELEASE (compile),
org.springframework:spring-dao:jar:1.2.5 (test), junit:junit:jar:4.8.2 (test),
org.mockito:mockito-all:jar:1.8.5 (test), mysql:mysql-connector-java:jar:5.1.13 (provided),
com.oracle:ojdbc6:jar:11.2.0.1.0 (provided), log4j:log4j:jar:1.2.16 (compile),
org.springframework:spring-context:jar:3.0.5.RELEASE (test), org.springframework:spring-
context-support:jar:3.0.5.RELEASE (compile), org.springframework.integration:spring-
integration-mail:jar:2.0.0.M4 (compile), org.springframework:spring-test:jar:3.0.5.RELEASE
(test)]: Failed to read artifact descriptor for ant:ant:jar:1.6.5-osgi: Could not transfer
artifact ant:ant:pom:1.6.5-osgi from/to nexus
(http://ournexusaddress:8081/nexus/content/groups/public): Checksum validation failed, could
not read expected checksum: C:\Users\andrea\.m2\repository\ant\ant\1.6.5-osgi\ant-1.6.5-
osgi.pom.sha1.tmp56e90fe6eda74ac3 (The system cannot find the file specified) -> [Help 1]
此时我使用选项-e -X和
运行mvn Caused by: org.sonatype.aether.transfer.ChecksumFailureException: Checksum validation failed,
could not read expected checksum: C:\Users\andrea\.m2\repository\ant\ant\1.6.5-osgi\ant-
1.6.5-osgi.pom.sha1.tmp56e90fe6eda74ac3 (The system cannot find the file
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.verifyChecksum(WagonRepositoryConnector.java:714)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:618)
... 4 more
Caused by: java.io.FileNotFoundException: C:\Users\andrea\.m2\repository\ant\ant\1.6.5-osgi\ant-1.6.5-osgi.pom.sha1.tmp56e90fe6eda74ac3 (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:120)
at org.sonatype.aether.util.ChecksumUtils.read(ChecksumUtils.java:47)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.verifyChecksum(WagonRepositoryConnector.java:710)
... 5 more
[ERROR]
[ERROR]
出于这个原因,我试图看看我是否可以在问题的顶部找到pom。我还添加了显式调用的依赖项。
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>1.7.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>sahi</groupId>
<artifactId>sahi</artifactId>
<version>3.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easyb</groupId>
<artifactId>easyb-core</artifactId>
<version>1.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.1.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
<scope>test</scope>
</dependency>
目前作为一种解决方法,我在我们的一个CI构建服务器(构建为绿色:-))的本地maven存储库中找到了一个未损坏的版本。 1.6.5-osgi,我将把它上传到nexus。
答案 0 :(得分:1)
http://mirrors.ibiblio.org/maven2/
提供镜像或尝试
<dependency>
<groupId>ant</groupId>
<artifactId>ant.osgi</artifactId>
<version>1.6.5</version>
</dependency>
或者
最新版本
<dependency>
<groupId>ant</groupId>
<artifactId>ant</artifactId>
<version>1.7.0</version>
</dependency>
Apache ivy maven config
<dependency>
<groupId>org.apache.ivy</groupId>
<artifactId>ivy</artifactId>
<version>2.1.0</version>
</dependency>
答案 1 :(得分:1)
<dependency>
<groupId>ant</groupId>
<artifactId>ant</artifactId>
<version>1.6.5-osgi</version>
<type>pom</type>// remove this
</dependency>
然后尝试
<dependency>
<groupId>ant</groupId>
<artifactId>ant</artifactId>
<version>1.6.5</version>
</dependency>