简体   繁体   中英

Importing a source dependency with Gradle (Kotlin DSL)

I want to import version 1.0.0 of this project https://github.com/whichdigital/ksv as a source dependency in a Kotlin project using Gradle 6.3 with Kotlin DSL.

As the page tells me I added this into the settings.gradle.kts of my project

sourceControl {
    gitRepository(java.net.URI.create("https://github.com/whichdigital/ksv.git")) {
        producesModule("uk.co.whichdigital:ksv")
    }
}

and using this dependency in my build.gradle.kts file:

implementation("uk.co.whichdigital:ksv:1.0.0")

trying to import tagged version/release 1.0.0 of the KSV repo. But building my project (importing the KSV repo) fails with following expection:

TaskDependencyResolveException: Could not determine the dependencies of task ':bootJar'.
...
Caused by: DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all task dependencies for configuration ':runtimeClasspath'.
....
Caused by: ModuleVersionResolveException: Git repository at https://github.com/whichdigital/ksv.git did not contain a project publishing the specified dependency.
Required by:
    project :

I'm actually also the person who wrote/published the KSV-repository, so if there's some configuration that I missed, I can add it in the imported or importing project.

"uk.co.whichdigital:ksv:1.0.0" group id is wrong.

Can you please try

sourceControl {
   gitRepository(java.net.URI.create("https://github.com/whichdigital/ksv.git")) {
     producesModule("uk.co.whichdigital.ksv:ksv")
   }
}

implementation("uk.co.whichdigital.ksv:ksv:1.0.0")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM