-
Notifications
You must be signed in to change notification settings - Fork 329
Manage dependencies via Gradle version catalog #1452
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
codecholeric
reviewed
May 3, 2025
22276d1 to
0ea7fde
Compare
Collaborator
|
Thanks a lot, that looks like a really good idea to improve maintainability 😃 I finally found some time and added some fixup suggestions, please let me know what you think! |
Member
Author
|
Cool, thank you! I'm happy to include these. |
Signed-off-by: Manfred Hanke <Manfred.Hanke@tngtech.com> Signed-off-by: Peter Gafert <peter.gafert@archunit.org>
`it` in the `exclude(dependency { /*...*/ })` closure of
[DependencyFilter](https://github.com/GradleUp/shadow/blob/8.3.6/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/internal/DependencyFilter.groovy)
is a [`org.gradle.api.artifacts.ResolvedDependency`](https://docs.gradle.org/current/javadoc/org/gradle/api/artifacts/ResolvedDependency.html),
whose [`name`](https://github.com/gradle/gradle/blob/v8.13.0/platforms/software/dependency-management/src/main/java/org/gradle/api/internal/artifacts/DefaultResolvedDependency.java#L76-L78) is a `String`.
When the comparison `it.name != dependency.guava` was introduced with 18c5d18,
`dependency.guava` was String that could be compared against `it.name`,
but 82d61ad has changed this those to a `Map`.
However `dependency.guava` is relocated anyway – and hence removed by the `removeDuplicateThirdParty` task (as it is transitively available in `archunit.jar`),
so we can simply drop `dependency.guava` from not being excluded in the `shadowJar`.
Signed-off-by: Manfred Hanke <Manfred.Hanke@tngtech.com>
The [version catalog](https://docs.gradle.org/current/userguide/version_catalogs.html) `libs.version.toml` is [recognized by dependabot](https://docs.github.com/en/code-security/dependabot/ecosystems-supported-by-dependabot/supported-ecosystems-and-repositories#gradle). Signed-off-by: Manfred Hanke <Manfred.Hanke@tngtech.com> Signed-off-by: Peter Gafert <peter.gafert@archunit.org>
introducing a separate catalog for example dependencies to make it easier to see which dependencies are really meant for ArchUnit in all places. Signed-off-by: Manfred Hanke <Manfred.Hanke@tngtech.com> Signed-off-by: Peter Gafert <peter.gafert@archunit.org>
codecholeric
approved these changes
Jun 15, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Unlike the manual dependency management in the
Mapext.dependency, the Gradle version cataloglibs.version.tomlis recognized by dependabot.Dependency updates (like #1440) should be triggered automatically (cf. hankem#7), so we could probably revert #672 (although the daily nagging helps to remember that a new version is available 🙈).