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
Classifiers of version catalog are discarded while copied to anothor dependency #23096
Comments
Thank you for providing a valid reproducer. The issue is in the backlog of the relevant team and prioritized by them. |
- Kotlin does not support Java 19 as the target bytecode. As the default version follows the current Java version, a specific target is necessary for release. - Add a workaround that handles a regression in dependency in Gradle 7.6 See gradle/gradle#23096 for details.
This is confirmed working in 7.5.x and broken in 7.6. |
…ependency instances <!--- The issue this PR addresses --> Fixes #23096 All dependencies which extend `AbstractModuleDependency` should have their `attributesFactory` and `capabilityNotationParser` initialized. This is usually done in the `DefaultDependencyFactory`, though now that `MinimalExternalModuleDependency` extends `ExternalModuleDependency` and its implements extend `AbstractModuleDependency`, we must be sure that we initialize its services when we instantiate them. This PR does that. Further, we ensure we properly copy all fields in instances of `MinimalExternalModuleDependency` when copying them. This ensures we do not leave behind dependency artifacts or other data when adding dependencies to configurations via the project `DependencyHandler`. Co-authored-by: Justin Van Dort <jvandort@gradle.com>
* origin/release7x: Fix properly by injecting services into minimal dependencies when they are created initially Make configuration cache compatible Fix #23096 on release7x
Follow up for #23096 to ensure all properties are properly copied
- Kotlin does not support Java 19 as the target bytecode. As the default version follows the current Java version, a specific target is necessary for release. - Add a workaround that handles a regression in dependency in Gradle 7.6 See gradle/gradle#23096 for details. The PR reviewed in line/armeria#4466
Follow up for #23096 to ensure all properties are properly copied
Follow up for #23096 to ensure all properties are properly copied
…rties are copied Follow up for #23096 with a more comprehensive test. Ensures `targetConfiguration` is copied when version catalog dependencies are copied. This property was copied pre `7.6` but regressed in `7.6`. While fixing this bug, I discovered `endorsing` and `versionConstraint.branch` were also not copied. We are leaving those fixes out of this PR but will fix in `8.1`. See: #23286 Co-authored-by: Justin Van Dort <jvandort@gradle.com>
This commit broke my build with the following exception (company class names were obfuscated due to nda)
|
We do not provide backwards compatibility guarantees for internal APIs (https://docs.gradle.org/current/userguide/authoring_maintainable_build_scripts.html#sec:avoiding_gradle_internal_apis). You should ask the maintainer of that plugin to update it; and avoid the internal APIs if they can, or if they cannot, file a separate issue with their use case. |
Say a dependency is declared with a version catalog, and a classifier is set to the dependency.
If it is copied to another dependency configuration. the classifier is unexpectedly discarded in Gradle 7.6.
Expected Behavior
Classifiers should be preserved when a dependency is set to other dependencies.
Current Behavior
Classifiers are discarded if:
dependencies.add("customDeps", dep)
is used to copy an existing dependency.Context
This problem happens only in Gradle 7.6 and 7.5.x copies classifiers to other dependency configurations.
Steps to Reproduce
https://github.com/ikhoon/gradle-dependency-regression
If you execute
copyAndPrintDependencies
task by switching the Gradle version between Gradle 7.6 and 7.5,you can see different results depending on Gradle versions.
Your Environment
The problem is platform-independent. I can see the same result from all OSes.
The text was updated successfully, but these errors were encountered: