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

developmentOnly flag conflicts with Renovate and Dependency Locking #630

Open
mglazer opened this issue Jan 19, 2023 · 0 comments
Open

developmentOnly flag conflicts with Renovate and Dependency Locking #630

mglazer opened this issue Jan 19, 2023 · 0 comments

Comments

@mglazer
Copy link

mglazer commented Jan 19, 2023

Expected Behavior

I've found that if I enable dependency locking:

dependencyLocking { lockAllConfigurations() }

And have enabled renovate on my repository, I end up in a state where renovate attempts to write locks, causing a gradle.lockfile change to remove the developmentOnly configuration from every single dependency.

What this looks like is:

+ com.fasterxml.jackson.module:jackson-module-kotlin:2.13.4=compileClasspath,implementationDependenciesMetadata,nativeImageClasspath,nativeImageTestClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
- com.fasterxml.jackson.module:jackson-module-kotlin:2.13.4=compileClasspath,implementationDependenciesMetadata,developmentOnly,nativeImageClasspath,nativeImageTestClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath

Tracking this down a bit more, I found the real cause of this is because of this line:

developmentOnly.getDependencies().add(project.getDependencies().create("io.micronaut:micronaut-runtime-osx"));

Which will only run on OSX. So what happens is if you happen to merge any renovate change which removed the developmentOnly configuration entries (I would not expect renovate to run with OSX), then if you attempt to run:

./gradlew run

On an OSX machine, you'll get an error:

> Could not resolve all files for configuration ':developmentOnly'.
   > Resolved 'com.fasterxml.jackson.core:jackson-annotations:2.13.4' which is not part of the dependency lock state
   > Resolved 'io.micronaut:micronaut-http:3.7.4' which is not part of the dependency lock state
   > Resolved 'io.micronaut:micronaut-json-core:3.7.4' which is not part of the dependency lock state
   > Resolved 'io.micronaut:micronaut-jackson-core:3.7.4' which is not part of the dependency lock state
   > Resolved 'io.micronaut:micronaut-core-reactive:3.7.4' which is not part of the dependency lock state
   > Resolved 'javax.annotation:javax.annotation-api:1.3.2' which is not part of the dependency lock state
   > Resolved 'io.micronaut:micronaut-aop:3.7.4' which is not part of the dependency lock state
   > Resolved 'io.micronaut:micronaut-runtime-osx:3.7.4' which is not part of the dependency lock state
   > Resolved 'jakarta.annotation:jakarta.annotation-api:2.1.1' which is not part of the dependency lock state
   > Resolved 'org.reactivestreams:reactive-streams:1.0.4' which is not part of the dependency lock state
   > Resolved 'com.fasterxml.jackson.core:jackson-databind:2.13.4.2' which is not part of the dependency lock state
   > Resolved 'com.fasterxml.jackson.core:jackson-core:2.13.4' which is not part of the dependency lock state
   > Resolved 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.4' which is not part of the dependency lock state
   > Resolved 'io.micronaut:micronaut-inject:3.7.4' which is not part of the dependency lock state
   > Resolved 'org.slf4j:slf4j-api:1.7.36' which is not part of the dependency lock state
   > Resolved 'io.micronaut:micronaut-core:3.7.4' which is not part of the dependency lock state
   > Resolved 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.4' which is not part of the dependency lock state
   > Resolved 'io.micronaut:micronaut-jackson-databind:3.7.4' which is not part of the dependency lock state
   > Resolved 'javax.validation:validation-api:2.0.1.Final' which is not part of the dependency lock state
   > Resolved 'org.yaml:snakeyaml:1.33' which is not part of the dependency lock state
   > Resolved 'jakarta.inject:jakarta.inject-api:2.0.1' which is not part of the dependency lock state
   > Resolved 'io.projectreactor:reactor-core:3.4.23' which is not part of the dependency lock state
   > Resolved 'io.methvin:directory-watcher:0.16.1' which is not part of the dependency lock state
   > Resolved 'io.micronaut:micronaut-context:3.7.4' which is not part of the dependency lock state
   > Resolved 'net.java.dev.jna:jna:5.12.1' which is not part of the dependency lock state
   > Resolved 'io.micronaut:micronaut-runtime:3.7.4' which is not part of the dependency lock state

I've found the easiest way to hack around this is with:

configurations {
  developmentOnly {
    resolutionStrategy.deactivateDependencyLocking()
  }
}

Which obviously isn't great, but it at least makes things work well with dependency locking and renovate.

I could submit a PR which just disables this within the plugin, but obviously wanted to file a bug first in case anyone else has other ideas for a fix here (even if the fix is just documentation)

Actual Behaviour

No response

Steps To Reproduce

No response

Environment Information

No response

Example Application

No response

Version

3.6.5

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