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 Module Metadata should not have constraint with null version #20791

Closed
kostya3264 opened this issue May 15, 2022 · 1 comment
Closed
Labels
a:bug closed:duplicate Duplicated or superseeded by another issue in:gradle-module-metadata

Comments

@kostya3264
Copy link

Expected Behavior

If there is at least one dependency constraint without any version, Gradle Module Metadata should not be generated.
Validation should fail (based on the documentation https://github.com/gradle/gradle/blob/master/subprojects/docs/src/docs/design/gradle-module-metadata-latest-specification.md#variants-value)

Current Behavior

The Gradle Module Metadata can have a dependency constraint without any version. Validation fails only if all constraints don't have a version.

Context

We are trying to add a library which contains dependency constraint with Null version. Our build is failing with the following exception:

  Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve {lib_with_incorrect_dep_constraint}.
  Required by:
     project {project-name}
  Caused by: java.lang.NullPointerException

Is there any way to suppress reading Gradle Module Metadata file from dependency?

Steps to Reproduce

Create a constraints section in build.gradle with several dependencies, at least one of them should have a version, the other one should be without any version (the order doesn't matter), something like this

dependencies {
      constraints {
        implementation 'commons-io:commons-io'
        implementation 'joda-time:joda-time:2.9.9'
    }
}

Your Environment

Gradle 6.9.2

@hegyibalint
Copy link
Member

The fix will come with Gradle 7.5: #20182
If we are going to do a 6.9.3, we are also going to fix this issue (#20189).

@hegyibalint hegyibalint added in:gradle-module-metadata closed:duplicate Duplicated or superseeded by another issue and removed to-triage labels May 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug closed:duplicate Duplicated or superseeded by another issue in:gradle-module-metadata
Projects
None yet
Development

No branches or pull requests

2 participants