使用maven编译时,从github repo下载jar失败

时间:2013-08-30 04:07:46

标签: maven

我是Maven的新手。使用这里提到的指令:http://activeintelligence.org/blog/archive/hosting-maven-repository-for-third-party-jars-on-git-bitbucketgithub/,我为第三方jar创建了一个github maven repo。我可以在这里看到jar(和相应的pom):https://github.com/sushilmittal/wiki-keyword-extraction/tree/master/repository/com/rapid_i/rapidminer/5.3.006

我的pom.xml有以下两个条目对应上面的jar:

<dependency>
    <groupId>com.rapid_i</groupId>
    <artifactId>rapidminer</artifactId>
    <version>5.3.006</version>
</dependency>

<repositories>
    <repository>
        <id>wiki-keyword-extraction</id>
        <url>https://github.com/sushilmittal/wiki-keyword-extraction/tree/master/repository/</url>
    </repository>
</repositories>

当我进行mvn编译时,我收到以下警告:

正在下载:https://github.com/sushilmittal/wiki-keywordextraction/tree/master/repository/com/rapid_i/rapidminer/5.3.006/rapidminer-5.3.006.pom [警告]校验和验证失败,预计https://github.com/sushilmittal/wiki-keyword-extraction/tree/master/repository/com/rapid_i/rapidminer/5.3.006/rapidminer-5。 3.006.pom

进一步导致以下错误:

[错误]无法在项目DataIndex上执行目标:无法解析项目DataIndex的依赖项:DataIndex:jar:0.0.1-SNAPSHOT:找不到工件com.rapid_i:rapidminer:jar:5.3.006 in wiki-关键字提取(https://github.com/sushilmittal/wiki-keyword-extraction/master/repository/) - &gt; [帮助1]

如果我手动转到https://github.com/sushilmittal/wiki-keywordextraction/tree/master/repository/com/rapid_i/rapidminer/5.3.006/位置,我可以看到这些文件。所以我无法理解为什么maven无法从该位置下载jar / pom。

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

首先,请阅读this post

其次,使用源控制系统作为Maven存储库是非常糟糕的计划。建议的事情是使用Maven Repository Manager。至少有三种可用的实现,甚至还有一个在线托管服务。

第三,如果你坚持遵循这个误导的计划,你需要告诉Maven到GitHub仓库中的原始文件的https路径,而不是带有行号等的文件内容的HTML呈现。