使用github作为maven存储库校验和验证失败

时间:2013-05-23 15:40:30

标签: maven github repository checksum

我已经尝试将github用作我在那里托管的项目的maven存储库,但是我遇到了一些让它工作的问题。首先,这是项目:

https://github.com/dwatrous/cache4guice

我创建了一个分支'mvn-repo'来保存maven发布文件。我按照这个过程为该分支创建了maven文件:

http://blog.rueedlinger.ch/2012/09/use-github-as-maven-remote-repository/

我已经验证了文件在那里。然后我将其添加到pom.xml中,以获取使用cache4guice库的项目:

<repository>
    <id>com.github.cache4guice</id>
    <url>https://github.com/dwatrous/cache4guice/tree/mvn-repo</url>
    <!-- use snapshot version -->
    <snapshots>
        <enabled>true</enabled>
        <updatePolicy>always</updatePolicy>
    </snapshots>
</repository>

<dependency>
    <groupId>com.github</groupId>
    <artifactId>cache4guice</artifactId>
    <version>0.1</version>
</dependency>

当我构建时,我收到以下错误:

Downloading: https://github.com/dwatrous/cache4guice/tree/mvn-repo/com/github/cache4guice/0.1/cache4guice-0.1.pom
Checksum validation failed, expected <!DOCTYPE but is 6ca9a53135148bf33e1b08aadc611b65489b4991 for https://github.com/dwatrous/cache4guice/tree/mvn-repo/com/github/cache4guice/0.1/cache4guice-0.1.pom
Checksum validation failed, expected <!DOCTYPE but is 57e202c6b25139da08d065550ebd8c50d9f7d162 for https://github.com/dwatrous/cache4guice/tree/mvn-repo/com/github/cache4guice/0.1/cache4guice-0.1.pom

Downloaded: https://github.com/dwatrous/cache4guice/tree/mvn-repo/com/github/cache4guice/0.1/cache4guice-0.1.pom (38 KB at 2.7 KB/sec)
The POM for com.github:cache4guice:jar:0.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
Downloading: http://morphia.googlecode.com/svn/mavenrepo/com/github/cache4guice/0.1/cache4guice-0.1.jar

Downloading: https://github.com/dwatrous/cache4guice/tree/mvn-repo/com/github/cache4guice/0.1/cache4guice-0.1.jar
Checksum validation failed, expected <!DOCTYPE but is 12bd0042aad0971621728f9ba3c048106ef8a84e for https://github.com/dwatrous/cache4guice/tree/mvn-repo/com/github/cache4guice/0.1/cache4guice-0.1.jar
Checksum validation failed, expected <!DOCTYPE but is 1506b45c11f00ba484462660f61a83ac14620761 for https://github.com/dwatrous/cache4guice/tree/mvn-repo/com/github/cache4guice/0.1/cache4guice-0.1.jar

Downloaded: https://github.com/dwatrous/cache4guice/tree/mvn-repo/com/github/cache4guice/0.1/cache4guice-0.1.jar (23 KB at 4.7 KB/sec)

最终这个:

COMPILATION ERROR : 
-------------------------------------------------------------
error: error reading C:\Users\watrous\.m2\repository\com\github\cache4guice\0.1\cache4guice-0.1.jar; error in opening zip file

我检查过,jar文件看起来确实是假的。我无法使用zip实用程序打开它,其大小略大于存储库中的大小。

我知道哪里出错了或为什么文件maven正在变得似乎是假的?

1 个答案:

答案 0 :(得分:0)

事实证明这很简单。我只需要更改存储库声明以引用 raw.github.com ,如下所示:

<repository>
    <id>com.github.cache4guice</id>
    <url>https://raw.github.com/dwatrous/cache4guice/mvn-repo</url>
    <!-- use snapshot version -->
    <snapshots>
        <enabled>true</enabled>
        <updatePolicy>always</updatePolicy>
    </snapshots>
</repository>

我仍然遇到校验和问题,但所有文件都正常下载,我可以构建。

相关问题