我正在尝试使用一个私有的Github存储库作为Maven存储库,遵循本页面上的说明:Hosting a Maven Repository in Github
我能够正确地部署,并且我可以看到工件(jars、poms等)。部署到Github代码库。
不起作用的是使用这个存储库来提取依赖项。在日志中,我可以看到pom正在尝试下载,但失败了。
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://raw.githubusercontent.com/ORGANIZATION/mvn-repo/master/ with username=randymay, password=***
Downloading: https://raw.githubusercontent.com/ORGANIZATION/mvn-repo/master/org/hibernate/hibernate/3.2.7.patched/hibernate-3.2.7.patched.pom
[WARNING] The POM for org.hibernate:hibernate:jar:3.2.7.patched is missing, no dependency information available如果我在curl请求中使用该URL (具有基本身份验证),我就能够下载pom。
curl -v https://randymay:*****@raw.githubusercontent.com/ORGANIZATION/mvn-repo/master/org/hibernate/hibernate/3.2.7.patched/hibernate-3.2.7.patched.pom在日志中,它实际上是在尝试下载jar:
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://raw.githubusercontent.com/ORGANIZATION/mvn-repo/master/ with username=randymay, password=***
Downloading: https://raw.githubusercontent.com/ORGANIZATION/mvn-repo/master/org/hibernate/hibernate/3.2.7.patched/hibernate-3.2.7.patched.jar
Could not find artifact org.hibernate:hibernate:jar:3.2.7.patched in github (https://raw.githubusercontent.com/ORGANIZATION/mvn-repo/master/)下面是我的pom.xml的存储库部分:
<repositories>
<!-- Repositories -->
<repository>
<id>github</id>
<url>https://raw.githubusercontent.com/ORGANIZATION/mvn-repo/master/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
</repository>
</repositories>下面是我在settings.xml中的服务器条目:
<server>
<id>github</id>
<username>randymay</username>
<password>*****</password>
</server>请注意,在参考文章中,他们使用了'raw.github.com‘域。我一开始试过了,也遇到了同样的问题。当我使用curl连接到该域时,我收到了一个'moved permanently‘错误。我使用的是'raw.githubusercontent.com‘,因为这是我能够成功使用curl的url。如果这不正确,请让我知道。
任何帮助都将不胜感激。提前谢谢。
https://stackoverflow.com/questions/38483847
复制相似问题