0

我有以下依赖:

    <dependency>
      <groupId>ant</groupId>
      <artifactId>ant</artifactId>
      <version>1.6.5-osgi</version>
    </dependency>

它在 Maven 中央存储库中不可用。我可以选择哪个镜像来正确解决它(本地安装并部署到我们的内部存储库)?

更新我从我需要添加一些细节的答案中看到。我们的任何 pom 中都没有明确设置这种依赖关系。调用 maven install 时会发生失败,原因是找不到它。我发布了完整的堆栈:

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

4

2 回答 2

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

<dependency>
    <groupId>org.apache.ivy</groupId>
    <artifactId>ivy</artifactId>
    <version>2.1.0</version>
</dependency>
于 2013-09-13T16:40:59.753 回答
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>
于 2013-09-13T16:41:18.890 回答