gradle/github-dependency-graph-gradle-plugin

Dependency resolution does not take constraint dependency versions into account

Closed this issue · 4 comments

Hey all,
I have a small request for advise.

We have a Kotlin project with a build.gradle.kts file in the root and a sub-folder containing another build.gradle.kts file. In that sub-folder file we define dependencies and constraints.

For some reason the generated dependency graph still has the dependency versions which are actually overwritten by the constraints. Is this the expected behavior?

Thanks a lot and have a nice day
👋

bigdaz commented

The generated dependency graph contains versions that are actually resolved during your build execution, so the dependency constraints certainly are taken into account.

  • What Gradle task(s) are you running to generate the graph?
  • Are you able to share a link to the GitHub Actions run?
  • Even better, can you publish a Gradle Build Scan for the execution and share that?

Hey @bigdaz
thanks for the quick reply.

We use the gradle/gradle-build-action@v2.8.0 with dependency-graph: generate-and-submit which internally uses the github-dependency-graph-gradle-plugin for creating the dependency graph and uploading it to GitHub.

Unfortunately I am not able to share the GH Actions run as this is happening in a private repo.

I am now out for a week and will provide further details when I am back. Please let me know what information would help you. If necessary I will create a sample repo and try to reproduce the situation.

👋

bigdaz commented

What Gradle task(s) are you running to generate the graph?

The gradle-build-action simply collects the dependencies that are resolved during Gradle execution. So you're either passing arguments to the action to tell it what to execute, or you're executing a Gradle task(s) in a later step.

The actual task(s) executed are what determines the graph that is submitted.

In your case, you must be executing a task in the root project that doesn't read the sub-project dependency constraints.

Hey @bigdaz,
unfortunately I was not able to figure out what I am doing wrong but I also don't have time to investigate any further.
I will close this issue for now and maybe create a new one in the future if I'll have new information.

Thanks for your help.