首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将github用作maven存储库校验和验证失败

将github用作maven存储库校验和验证失败
EN

Stack Overflow用户
提问于 2013-05-23 23:40:30
回答 1查看 3.1K关注 0票数 0

我曾尝试使用github作为我在那里托管的一个项目的maven存储库,但我在使用它时遇到了一些问题。首先,这是一个项目:

https://github.com/dwatrous/cache4guice

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

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

我已经确认了文件就在上面。然后,我将此代码添加到使用cache4guice库的项目的pom.xml中:

代码语言:javascript
复制
<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>

代码语言:javascript
复制
<dependency>
    <groupId>com.github</groupId>
    <artifactId>cache4guice</artifactId>
    <version>0.1</version>
</dependency>

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

代码语言:javascript
复制
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)

最终是这样的:

代码语言:javascript
复制
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得到的文件看起来是假的?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-05-24 00:08:46

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

代码语言:javascript
复制
<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>

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

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16718263

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档