I’ve uploaded my own library over github packages ...
# gradle
j
I’ve uploaded my own library over github packages : https://github.com/BeiningBogen/statemachine/packages/398001 Now I’m trying to use it from an android app like so :
Copy code
allprojects {
    repositories {
        google()
        jcenter()
        maven {
            name = "GitHubPackages"
            url = uri("<https://maven.pkg.github.com/beiningbogen/statemachine>")
            credentials {
                username = project.extra["gpr.user"].toString()
                password = project.extra["gpr.key"].toString()
            }
        }
    }
}
...
dependencies {
    implementation("no.beiningbogen.StateMachine-jvm:statemachine-jvm:0.1.1")
}
but I keep getting
Failed to resolve: no.beiningbogen.StateMachine-jvm:statemachine-jvm:0.1.1
Is there a specific thing I need to do with the kotlin dsl to be able to use Maven Pom style dependencies?
g
Failed to resolve
Show full error message with resolution, it may have some additional information
j
simple
gradle build
gives :
Copy code
* What went wrong:
Could not determine the dependencies of task ':app:compileStagingJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:stagingCompileClasspath'.
   > Could not find no.beiningbogen.StateMachine-jvm:statemachine-jvm:0.1.1.
     Required by:
         project :app
gradle build --stacktrace
gives :
Copy code
org.gradle.api.internal.tasks.TaskDependencyResolveException: Could not determine the dependencies of task ':app:compileStagingJavaWithJavac'.
        at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.getDependencies(CachingTaskDependencyResolveContext.java:69)
...
...
...
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all task dependencies for configuration ':app:stagingCompileClasspath'.
...
...
...
Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find no.beiningbogen.StateMachine-jvm:statemachine-jvm:0.1.1.
Required by:
    project :app
g
It should show list of repositories
I see all repos and urls which were checked
Even for your dependency, this what I see:
Copy code
$ ./gradlew test

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':legacy:compileReleaseKotlin'.
> Could not resolve all files for configuration ':legacy:releaseRuntimeClasspath'.
   > Could not find no.beiningbogen.StateMachine-jvm:statemachine-jvm:0.1.1.
     Searched in the following locations:
       - <https://dl.google.com/dl/android/maven2/no/beiningbogen/StateMachine-jvm/statemachine-jvm/0.1.1/statemachine-jvm-0.1.1.pom>
       - <https://jcenter.bintray.com/no/beiningbogen/StateMachine-jvm/statemachine-jvm/0.1.1/statemachine-jvm-0.1.1.pom>
     Required by:
         project :legacy
j
ok, so maybe I placed the maven spec in the wrong place? For now it’s in my top level
build.gradle.kts
g
place looks correct. Which version of Gradle do you use?
j
version 6.1.1 I tried in a dummy project I have also, and I couldn’t see the repo gradle checked neither 🤔
g
maybe it some more recent version, I see it at least on 6.5
j
nop, updated my version and nothing changes