gradle构建在依赖更新后出现问题。

huangapple go评论82阅读模式
英文:

gradle build broken after dependency update

问题

I use gradle to build a java project (ASCIIGenome).

One of the dependencies of ASCIIGenome is a repository on GitHub (htsjdk, as you can see, it's a fork with some of my changes). The ASCIIGenome project builds successfully if I use this commit of htsjdk in build.gradle:

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

I made edits to htsjdk, so now the dependency is:

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

However, after making this change, the build fails with the following error:

./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

I can't understand why htsjdk:80e355c is working fine, while htsjdk:609ca91 is causing the build to fail. Do you have any idea which changes might be breaking the build? Please let me know if more information is needed.

英文:

I use gradle to build a java project (ASCIIGenome).

One of the dependencies of ASCIIGenome is a repository on github (htsjdk, as you can see is a fork with some changes of mine). The ASCIIGenome project builds fine if I use this commit of htsjdk in build.gradle:

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

I made edits to htsjdk so now the dependency is

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

and now the build fails with the following:

./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

I can't understand why htsjdk:80e355c is ok while htsjdk:609ca91 fails. Any idea what changes break the build? Please let me know if more information is necessary

答案1

得分: 1

这原来是 htsjdk 的 .gitignore 仓库中有一个错误,导致某些文件被忽略,因此 htsjdk 依赖关系出现问题。修复 .gitignore 后,问题得以解决。

英文:

It turns out there is a bug in the .gitignore repository of htsjdk that caused some files to be ignored so the htsjdk dependency was broken. Fixing .gitignore fixed my problem.

huangapple
  • 本文由 发表于 2020年8月23日 01:36:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/63539191.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定