我试图弄清楚如何配置pom文件以添加在Github上发布但未出现在中央存储库中的依赖项。 jpen库在这里发布:
https://github.com/qupath/qupath/tree/master/maven/repo/net/sourceforge/jpen/jpen/2-150301
以下是我添加到POM文件中的内容:
<project>
...
<repositories>
<repository>
<id>msel.releases</id>
<url>https://github.com/qupath/qupath/tree/master/maven/repo/net/sourceforge/jpen/jpen/2-150301</url>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</releases>
</repository>
</repositories>
<dependencies>
...
<dependency>
<groupId>net.sourceforge.jpen</groupId>
<artifactId>jpen</artifactId>
<version>4.0.0</version>
</dependency>
</dependencies>
</project>
我编译时得到:
Failed to execute goal on project MacawSwing:
Could not resolve dependencies for project com.kitfox.macaw:MacawSwing:jar:1.0-SNAPSHOT:
Failed to collect dependencies for [com.kitfox.macaw:MacawCore:jar:1.0-SNAPSHOT (compile),
com.kitfox.docking:MacawDocking:jar:1.0-SNAPSHOT (compile),
net.sourceforge.jpen:jpen:jar:4.0.0 (compile),
javax.vecmath:vecmath:jar:1.5.2 (compile)]:
Failed to read artifact descriptor for com.kitfox.docking:MacawDocking:jar:1.0-SNAPSHOT:
Failure to find com.kitfox.macaw:Macaw:pom:1.0-SNAPSHOT in https://github.com/qupath/qupath/tree/master/maven/repo/net/sourceforge/jpen/jpen/2-150301
was cached in the local repository, resolution will not be reattempted until the update interval of msel.releases has elapsed or updates are forced -> [Help 1]
在我尝试添加jpen依赖项之前,其他依赖项在我的计算机上还是在本地计算机中,还是可以很好地编译。
我该如何解决?
答案 0 :(得分:1)
一些选项:
还建议使用已发布或标记的版本,而不是快照版本。