Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Fix snapshot handling with Gradle Module Metadata

This commit fixes a couple of bugs:

1. if Gradle Module Metadata was published and consumed, then

the `changing` flag for the resolved component metadata wouldn't

be set to `true`, which means that snapshot would effectively be

considered as persistent

2. the publish test fixtures were not using the right, timestamped,

version id for the metadata and artifacts in case of unique snapshots,

which caused the resolution to fallback to the POM file

In addition, this fixes the generated module metadata file which

was uploaded _without_ substution the the SNAPSHOT version with

the timestamped version when published on external repositories.

Finally, this highlighted a couple of issues with test fixtures

which were still using Gradle Module Metadata when they shouldn't.

Fixes #10916

    • -2
    • +91
    ./MavenSnapshotResolveIntegrationTest.groovy
  1. … 10 more files in changeset.
Improve error message when build fails because of missing metadata

Gradle 6.0 removed the "artifact" metadata source by default.

This means that if a module is published _only_ with an artifact,

previous version of Gradle would find it, but 6.0 would fail with

a module missing exception.

The problem is that it's hard to realize that the issue comes

from the change of this default artifact sources.

This commit tries to improve the situation by recognizing that

a failure is related to not finding metadata, and in this case

would suggest that if the metadata is missing, it is still

possible that the jar is present.

The drawback of this approach is that we're unsure: if, for

some reason, the module is _really_ absent, then we gave a

wrong advice. This means, in particular, in case of wrong

coordinates.

    • -0
    • +6
    ./MavenBrokenRemoteResolveIntegrationTest.groovy
    • -0
    • +1
    ./MavenLocalRepoResolveIntegrationTest.groovy
    • -0
    • +1
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
    • -0
    • +1
    ./MavenSnapshotResolveIntegrationTest.groovy
  1. … 9 more files in changeset.
Improve error message when build fails because of missing metadata

Gradle 6.0 removed the "artifact" metadata source by default.

This means that if a module is published _only_ with an artifact,

previous version of Gradle would find it, but 6.0 would fail with

a module missing exception.

The problem is that it's hard to realize that the issue comes

from the change of this default artifact sources.

This commit tries to improve the situation by recognizing that

a failure is related to not finding metadata, and in this case

would suggest that if the metadata is missing, it is still

possible that the jar is present.

The drawback of this approach is that we're unsure: if, for

some reason, the module is _really_ absent, then we gave a

wrong advice. This means, in particular, in case of wrong

coordinates.

    • -0
    • +6
    ./MavenBrokenRemoteResolveIntegrationTest.groovy
    • -0
    • +1
    ./MavenLocalRepoResolveIntegrationTest.groovy
    • -0
    • +1
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
    • -0
    • +1
    ./MavenSnapshotResolveIntegrationTest.groovy
  1. … 3 more files in changeset.
Improve error message when build fails because of missing metadata

Gradle 6.0 removed the "artifact" metadata source by default.

This means that if a module is published _only_ with an artifact,

previous version of Gradle would find it, but 6.0 would fail with

a module missing exception.

The problem is that it's hard to realize that the issue comes

from the change of this default artifact sources.

This commit tries to improve the situation by recognizing that

a failure is related to not finding metadata, and in this case

would suggest that if the metadata is missing, it is still

possible that the jar is present.

The drawback of this approach is that we're unsure: if, for

some reason, the module is _really_ absent, then we gave a

wrong advice. This means, in particular, in case of wrong

coordinates.

    • -0
    • +6
    ./MavenBrokenRemoteResolveIntegrationTest.groovy
    • -0
    • +1
    ./MavenLocalRepoResolveIntegrationTest.groovy
    • -0
    • +1
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
    • -0
    • +1
    ./MavenSnapshotResolveIntegrationTest.groovy
  1. … 9 more files in changeset.
Improve error message when build fails because of missing metadata

Gradle 6.0 removed the "artifact" metadata source by default.

This means that if a module is published _only_ with an artifact,

previous version of Gradle would find it, but 6.0 would fail with

a module missing exception.

The problem is that it's hard to realize that the issue comes

from the change of this default artifact sources.

This commit tries to improve the situation by recognizing that

a failure is related to not finding metadata, and in this case

would suggest that if the metadata is missing, it is still

possible that the jar is present.

The drawback of this approach is that we're unsure: if, for

some reason, the module is _really_ absent, then we gave a

wrong advice. This means, in particular, in case of wrong

coordinates.

    • -0
    • +6
    ./MavenBrokenRemoteResolveIntegrationTest.groovy
    • -0
    • +1
    ./MavenLocalRepoResolveIntegrationTest.groovy
    • -0
    • +1
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
    • -0
    • +1
    ./MavenSnapshotResolveIntegrationTest.groovy
  1. … 9 more files in changeset.
Variant aware and legacy dependency setup invalid

A dependency declaration either needs to be about variant aware

dependency management with attributes and capabilities or about legacy

artifacts and configuration.

Mixing the two is now disallowed explicitly.

Issue #10532

    • -0
    • +17
    ./MavenDependencyResolveIntegrationTest.groovy
  1. … 2 more files in changeset.
Variant aware and legacy dependency setup invalid

A dependency declaration either needs to be about variant aware

dependency management with attributes and capabilities or about legacy

artifacts and configuration.

Mixing the two is now disallowed explicitly.

Issue #10532

    • -0
    • +17
    ./MavenDependencyResolveIntegrationTest.groovy
  1. … 2 more files in changeset.
Variant aware and legacy dependency setup invalid

A dependency declaration either needs to be about variant aware

dependency management with attributes and capabilities or about legacy

artifacts and configuration.

Mixing the two is now disallowed explicitly.

Issue #10532

    • -0
    • +17
    ./MavenDependencyResolveIntegrationTest.groovy
  1. … 2 more files in changeset.
Adjust test fixtures and test to ivy behavior changes

    • -6
    • +6
    ./MixedMavenAndIvyModulesIntegrationTest.groovy
  1. … 38 more files in changeset.
Fixes

    • -6
    • +6
    ./MixedMavenAndIvyModulesIntegrationTest.groovy
  1. … 29 more files in changeset.
Fixes

    • -6
    • +6
    ./MixedMavenAndIvyModulesIntegrationTest.groovy
  1. … 19 more files in changeset.
Fixes

    • -6
    • +6
    ./MixedMavenAndIvyModulesIntegrationTest.groovy
  1. … 31 more files in changeset.
Align implementations of artifact identifier display names

DefaultModuleComponentArtifactIdentifier now behaves similar as

ComponentFileArtifactIdentifier (showing the full actual file name).

This means that the artifact name used during reporting now

contains the version at the usual position in the file name.

This way it shows the actual file name for artifacts originating

from pom-only maven repositories (except snapshots, which show the

SNAPSHOT placeholder) and ivy repositories with default pattern.

The motivation for this alignment is to get the same representation for

the same file, independent of whether it was sourced from traditional

or Gradle module metadata.

    • -2
    • +2
    ./MavenBrokenRemoteResolveIntegrationTest.groovy
    • -2
    • +2
    ./MavenDynamicResolveIntegrationTest.groovy
    • -1
    • +1
    ./MavenJvmLibraryArtifactResolutionIntegrationTest.groovy
    • -1
    • +1
    ./MavenModuleArtifactResolutionIntegrationTest.groovy
    • -1
    • +1
    ./MavenPomPackagingResolveIntegrationTest.groovy
    • -2
    • +2
    ./MavenSnapshotResolveIntegrationTest.groovy
  1. … 27 more files in changeset.
Align implementations of artifact identifier display names

DefaultModuleComponentArtifactIdentifier now behaves similar as

ComponentFileArtifactIdentifier (showing the full actual file name).

This means that the artifact name used during reporting now

contains the version at the usual position in the file name.

This way it shows the actual file name for artifacts originating

from pom-only maven repositories (except snapshots, which show the

SNAPSHOT placeholder) and ivy repositories with default pattern.

The motivation for this alignment is to get the same representation for

the same file, independent of whether it was sourced from traditional

or Gradle module metadata.

    • -2
    • +2
    ./MavenBrokenRemoteResolveIntegrationTest.groovy
    • -2
    • +2
    ./MavenDynamicResolveIntegrationTest.groovy
    • -1
    • +1
    ./MavenJvmLibraryArtifactResolutionIntegrationTest.groovy
    • -1
    • +1
    ./MavenModuleArtifactResolutionIntegrationTest.groovy
    • -1
    • +1
    ./MavenPomPackagingResolveIntegrationTest.groovy
    • -2
    • +2
    ./MavenSnapshotResolveIntegrationTest.groovy
  1. … 27 more files in changeset.
Module test fixture: add 'category' attribute to api/runtime variants

This reflects the default variant attributes of a published

java component.

    • -1
    • +1
    ./MavenGradleMetadataRedirectionIntegrationTest.groovy
  1. … 13 more files in changeset.
Module test fixture: add 'category' attribute to api/runtime variants

This reflects the default variant attributes of a published

java component.

    • -1
    • +1
    ./MavenGradleMetadataRedirectionIntegrationTest.groovy
  1. … 13 more files in changeset.
Do not drop variant attributes for 'traditional' maven artifacts

FixedComponentArtifacts dropped the variant attributes (stored in

ConfigurationMetadata) for no clear reason. Because of this, the

attributes in the resolve result differed depending on whether the

variant was constructed from pom or GMM.

    • -1
    • +1
    ./MavenGradleMetadataRedirectionIntegrationTest.groovy
  1. … 27 more files in changeset.
Adjust tests and samples to new metadata sources defaults

    • -6
    • +1
    ./BadPomFileResolveIntegrationTest.groovy
    • -2
    • +0
    ./ClassifierToVariantResolveIntegrationTest.groovy
    • -13
    • +0
    ./MavenBrokenRemoteResolveIntegrationTest.groovy
    • -6
    • +19
    ./MavenDynamicResolveIntegrationTest.groovy
    • -2
    • +2
    ./MavenGradleMetadataRedirectionIntegrationTest.groovy
    • -6
    • +2
    ./MavenHttpRepoResolveIntegrationTest.groovy
    • -6
    • +2
    ./MavenJvmLibraryArtifactResolutionIntegrationTest.groovy
    • -3
    • +2
    ./MavenLocalDependencyWithGradleMetadataResolutionIntegrationTest.groovy
    • -1
    • +0
    ./MavenLocalRepoResolveIntegrationTest.groovy
    • -1
    • +9
    ./MavenModuleArtifactResolutionIntegrationTest.groovy
    • -3
    • +0
    ./MavenParentPomResolveIntegrationTest.groovy
    • -1
    • +0
    ./MavenPomPackagingResolveIntegrationTest.groovy
    • -1
    • +0
    ./MavenPomRelocationIntegrationTest.groovy
    • -10
    • +19
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
    • -4
    • +0
    ./MavenSnapshotResolveIntegrationTest.groovy
  1. … 81 more files in changeset.
wip - fix more tests

    • -6
    • +1
    ./BadPomFileResolveIntegrationTest.groovy
    • -2
    • +0
    ./ClassifierToVariantResolveIntegrationTest.groovy
    • -13
    • +0
    ./MavenBrokenRemoteResolveIntegrationTest.groovy
    • -6
    • +19
    ./MavenDynamicResolveIntegrationTest.groovy
    • -2
    • +2
    ./MavenGradleMetadataRedirectionIntegrationTest.groovy
    • -2
    • +0
    ./MavenHttpRepoResolveIntegrationTest.groovy
    • -6
    • +2
    ./MavenJvmLibraryArtifactResolutionIntegrationTest.groovy
    • -1
    • +0
    ./MavenLocalRepoResolveIntegrationTest.groovy
    • -1
    • +9
    ./MavenModuleArtifactResolutionIntegrationTest.groovy
    • -3
    • +0
    ./MavenParentPomResolveIntegrationTest.groovy
    • -1
    • +0
    ./MavenPomPackagingResolveIntegrationTest.groovy
    • -1
    • +0
    ./MavenPomRelocationIntegrationTest.groovy
    • -4
    • +0
    ./MavenSnapshotResolveIntegrationTest.groovy
  1. … 34 more files in changeset.
wip - fix more tests

    • -6
    • +1
    ./BadPomFileResolveIntegrationTest.groovy
    • -13
    • +0
    ./MavenBrokenRemoteResolveIntegrationTest.groovy
  1. … 13 more files in changeset.
wip - fix more tests

    • -6
    • +1
    ./BadPomFileResolveIntegrationTest.groovy
    • -2
    • +0
    ./ClassifierToVariantResolveIntegrationTest.groovy
    • -13
    • +0
    ./MavenBrokenRemoteResolveIntegrationTest.groovy
    • -6
    • +19
    ./MavenDynamicResolveIntegrationTest.groovy
    • -2
    • +2
    ./MavenGradleMetadataRedirectionIntegrationTest.groovy
    • -6
    • +2
    ./MavenJvmLibraryArtifactResolutionIntegrationTest.groovy
    • -1
    • +0
    ./MavenLocalRepoResolveIntegrationTest.groovy
    • -1
    • +9
    ./MavenModuleArtifactResolutionIntegrationTest.groovy
    • -3
    • +0
    ./MavenParentPomResolveIntegrationTest.groovy
    • -1
    • +0
    ./MavenPomPackagingResolveIntegrationTest.groovy
    • -1
    • +0
    ./MavenPomRelocationIntegrationTest.groovy
    • -4
    • +0
    ./MavenSnapshotResolveIntegrationTest.groovy
  1. … 34 more files in changeset.
wip - fix more tests

    • -6
    • +1
    ./BadPomFileResolveIntegrationTest.groovy
    • -2
    • +0
    ./ClassifierToVariantResolveIntegrationTest.groovy
    • -13
    • +0
    ./MavenBrokenRemoteResolveIntegrationTest.groovy
    • -6
    • +19
    ./MavenDynamicResolveIntegrationTest.groovy
    • -2
    • +2
    ./MavenGradleMetadataRedirectionIntegrationTest.groovy
    • -2
    • +0
    ./MavenHttpRepoResolveIntegrationTest.groovy
    • -6
    • +2
    ./MavenJvmLibraryArtifactResolutionIntegrationTest.groovy
    • -1
    • +0
    ./MavenLocalRepoResolveIntegrationTest.groovy
    • -1
    • +9
    ./MavenModuleArtifactResolutionIntegrationTest.groovy
    • -3
    • +0
    ./MavenParentPomResolveIntegrationTest.groovy
    • -1
    • +0
    ./MavenPomPackagingResolveIntegrationTest.groovy
    • -1
    • +0
    ./MavenPomRelocationIntegrationTest.groovy
    • -4
    • +0
    ./MavenSnapshotResolveIntegrationTest.groovy
  1. … 34 more files in changeset.
Adjust tests and samples to new metadata sources defaults

    • -4
    • +2
    ./MavenHttpRepoResolveIntegrationTest.groovy
  1. … 15 more files in changeset.
Adjust tests and samples to new metadata sources defaults

    • -4
    • +2
    ./MavenHttpRepoResolveIntegrationTest.groovy
  1. … 15 more files in changeset.
Adjust tests and samples to new metadata sources defaults

    • -4
    • +2
    ./MavenHttpRepoResolveIntegrationTest.groovy
  1. … 15 more files in changeset.
Adjust tests following Gradle Module Metadata feature preview removal

    • -3
    • +2
    ./MavenLocalDependencyWithGradleMetadataResolutionIntegrationTest.groovy
    • -10
    • +19
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 28 more files in changeset.
Adjust tests following Gradle Module Metadata feature preview removal

    • -3
    • +2
    ./MavenLocalDependencyWithGradleMetadataResolutionIntegrationTest.groovy
    • -10
    • +19
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 28 more files in changeset.
Adjust tests following Gradle Module Metadata feature preview removal

    • -3
    • +2
    ./MavenLocalDependencyWithGradleMetadataResolutionIntegrationTest.groovy
    • -10
    • +19
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 28 more files in changeset.
First elements of a compatibility mode for classifiers in Gradle Metadata

This commit introduces a synthetic attribute used for compatibility

purposes when a dependency declaration uses classifiers. It is

transparently converted to a dependency attribute on Gradle Module

Metadata, and this attribute is used in a specific manner during

resolution (it's actually converted _back to_ an artifact selection).

    • -0
    • +44
    ./MavenDependencyResolveIntegrationTest.groovy
  1. … 11 more files in changeset.
First elements of a compatibility mode for classifiers in Gradle Metadata

This commit introduces a synthetic attribute used for compatibility

purposes when a dependency declaration uses classifiers. It is

transparently converted to a dependency attribute on Gradle Module

Metadata, and this attribute is used in a specific manner during

resolution (it's actually converted _back to_ an artifact selection).

    • -0
    • +44
    ./MavenDependencyResolveIntegrationTest.groovy
  1. … 11 more files in changeset.