Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gradle plugin not resolving dependencies properly #699

Open
xenoterracide opened this issue Jun 8, 2024 · 1 comment
Open

gradle plugin not resolving dependencies properly #699

xenoterracide opened this issue Jun 8, 2024 · 1 comment

Comments

@xenoterracide
Copy link

# libs.versions.toml
dgs-codegen = { id = "com.netflix.dgs.codegen", version = "6.+" }
// build.gradle.kts
buildscript { dependencyLocking { lockAllConfigurations() } }

plugins {
  `java-library`
  alias(libs.plugins.dgs.codegen)
}

dependencyLocking {
  lockAllConfigurations()
}

tasks.withType<GenerateJavaTask>().configureEach {
  packageName = "com.xenoterracide.controller.registration"
  language = "java"
}
Configuration cache state could not be cached: field `classpath` of task `:controller-registration:compileJava` of type `org.gradle.api.tasks.compile.JavaCompile`: error writing value of type 'org.gradle.api.internal.artifacts.configurations.DefaultUnlockedConfiguration'
> Could not resolve all files for configuration ':controller-registration:compileClasspath'.
   > Resolved 'org.jetbrains:annotations:13.0' which is not part of the dependency lock state
   > Resolved 'org.jetbrains.kotlin:kotlin-stdlib:1.9.24' which is not part of the dependency lock state
   > Resolved 'com.netflix.graphql.dgs:graphql-dgs-platform:5.5.1' which is not part of the dependency lock state
   > Resolved 'com.netflix.graphql.dgs:graphql-dgs-platform-dependencies:5.5.1' which is not part of the dependency lock state

calling dependencies --write-locks (with some output filters

     +--- com.graphql-java:graphql-java:19.2 FAILED
|    +--- com.graphql-java:graphql-java:19.2 FAILED
|    +--- com.graphql-java:graphql-java:22.0 FAILED
|    +--- com.graphql-java:graphql-java:22.1 FAILED
|    +--- com.graphql-java:graphql-java:{prefer 18.3} FAILED
|    |    +--- com.graphql-java:graphql-java:{strictly [19.2, 20[; prefer 19.2; reject 18.2} FAILED
+--- com.netflix.graphql.dgs:graphql-dgs-platform FAILED

I tried adding things like com.netflix.graphql.dgs:graphql-dgs-platform:5.5.1 to implementation but that didn't fix it.

@xenoterracide
Copy link
Author

It would appear that I needed to add this, and that spring-boot-dependencies absolutely broke things

  implementation(platform(libs.dgs.platform.dependencies))
  implementation(libs.graphql.java)

note: those map to libs.versions.toml

dgs-platform-dependencies = { module = "com.netflix.graphql.dgs:graphql-dgs-platform-dependencies", version = "9.+" }
graphql-java = { module = "com.graphql-java:graphql-java" }

I think I tried using 5.+ first and had this problem... but I'm not certain.

could more about this please be added to the documentation? I'm fine with needing to add dependencies for the generated code but I'd like it to be documented. I'm not actually generally using DGS, was just going to use this plugin for spring-graphql.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant