首页 > 解决方案 > 依赖项更新后 gradle build 损坏

问题描述

我使用 gradle 构建一个 java 项目(ASCIIGenome)。

ASCIIGenome 的依赖项之一是 github 上的存储库(htsjdk,如您所见,它是我的一些更改的分支)。如果我使用以下提交,则 ASCIIGenome 项目构建htsjdk良好build.gradle

dependencies {
    ...
    compile 'com.github.dariober:htsjdk:80e355c'
    ...
}

我对 htsjdk 进行了编辑,所以现在依赖项是

compile 'com.github.dariober:htsjdk:609ca91'

现在构建失败并显示以下内容:

./gradlew build

FAILURE: Build failed with an exception.

* Where:
Build file '/home/dario/git_repos/ASCIIGenome/build.gradle' line: 77

* What went wrong:
Could not determine the dependencies of task ':jar'.
> Could not resolve all files for configuration ':compile'.
   > Could not find com.github.dariober:htsjdk:609ca91.
     Searched in the following locations:
       - https://jcenter.bintray.com/com/github/dariober/htsjdk/609ca91/htsjdk-609ca91.pom
       - https://jcenter.bintray.com/com/github/dariober/htsjdk/609ca91/htsjdk-609ca91.jar
       - https://jitpack.io/com/github/dariober/htsjdk/609ca91/htsjdk-609ca91.pom
       - https://jitpack.io/com/github/dariober/htsjdk/609ca91/htsjdk-609ca91.jar
     Required by:
         project :

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s

我不明白为什么htsjdk:80e355c可以,而htsjdk:609ca91失败。知道哪些更改会破坏构建吗?如果需要更多信息,请告诉我

标签: javagithubgradlebuild

解决方案


事实证明,htsjdk 的 .gitignore 存储库中存在一个错误,导致某些文件被忽略,因此 htsjdk 依赖关系被破坏。修复 .gitignore 解决了我的问题。


推荐阅读