MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
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
    • +1
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 12 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
    • +1
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 6 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
    • +1
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 12 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
    • +1
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 12 more files in changeset.
Adjust tests and samples to new metadata sources defaults

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

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

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

    • -10
    • +19
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 29 more files in changeset.
Let dependency-management tests not use deprecated configurations

    • -1
    • +1
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 27 more files in changeset.
Let dependency-management tests not use deprecated configurations

    • -1
    • +1
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 27 more files in changeset.
Let dependency-management tests not use deprecated configurations

    • -1
    • +1
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 27 more files in changeset.
Let dependency-management tests not use deprecated configurations

    • -1
    • +1
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 27 more files in changeset.
Fix tests for Gradle metadata 1.0

- Fix cross version test runtime classpath

- Remove test which is no longer true now that parsing is lenient

    • -41
    • +0
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 1 more file in changeset.
Rename writer/parser classes for consistency

    • -1
    • +1
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 21 more files in changeset.
Implement variant derivation strategy

This commit changes how Maven metadata is derived into variants. Now we will

only derive variants if the Java plugin is applied (the "base Java" plugin).

This is implemented via a variant derivation strategy, and allows fixing

the problem that a native component is unlikely to find sense in the derivation

of Java variants. This fixes a bug where the native plugins wouldn't be able

to consume native libraries published on Maven repositories, without Gradle

metadata.

    • -0
    • +1
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 43 more files in changeset.
Tidy up variant-names in integration tests

Instead of inlining the expected variant name in the module coordinates,

use `ResolveTestFixture.expectDefaultConfiguration(variant)`.

    • -9
    • +9
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 8 more files in changeset.
Enable improved POM support by default

This commit makes the experimental flag `IMPROVED_POM_SUPPORT` the default.

The flag is still there for backwards compatibility but has effectively no

impact. As a consequence, the behavior of improved POM support is now the

default, which implies that:

- Maven dependencies packaged as `pom` or `jar` now have derived variants

(`compile` and `runtime`) and we properly choose between the variants based

on the consumer attributes

- platform dependencies using the `platform` and `enforcedPlatform` keywords

are enabled

Enabling improved POM support by default is a **breaking change**: there's

a risk that resolved dependencies is different, in particular because we

will now only include the `compile` dependencies of a POM file whenever the

consumer asks for the API variant. There are also some changes in the

dependency insight reports due to the use of attribute based matching instead

of configuration selection.

Last but not least, this commit is likely to introduce a small performance

regression due to attribute based selection.

    • -3
    • +3
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 50 more files in changeset.
Improve error reporting in case no matching dynamic version is found

This commit improves rendering of errors in case resolution fails because

all versions in a dynamic range are evicted, and that at least one of the

evicted versions was evicted because of attribute matching. The error will

now report the attributes on each tested version, as well as the requested

attributes.

For this, the module not found exception has been updated to carry more

context, and now makes use of the tree formatter for consistency with other

exceptions in the codebase.

    • -2
    • +2
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 37 more files in changeset.
Transform FeaturePreviewsFixture to use the new API

Replaces injecting a property in the gradle.properties with injecting

the gradle.enableFeaturePreview in settings.gradle

    • -1
    • +1
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 16 more files in changeset.
Turn experimental option into gradle metadata option

Signed-off-by: Jendrik Johannes <jendrik@gradle.com>

    • -1
    • +1
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 18 more files in changeset.
Rename 'experimental features' to 'feature previews'

The idea behind this is that we have a set of feature previews rather

than one cryptic experimental flag.

A feature preview collects a set of related functionality (e.g.

everything related to gradle metadata) that changes existing behavior

and thus could potentially break existing builds. The preview options

will be removed with the next major release (currently 5.0) and the new

behaviour will then become the default.

Signed-off-by: Jendrik Johannes <jendrik@gradle.com>

    • -2
    • +2
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 45 more files in changeset.
Adjust tests and test fixtures to opt-in options split

Signed-off-by: Jendrik Johannes <jendrik@gradle.com>

    • -4
    • +4
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 13 more files in changeset.
Adjust tests to use the new experimental feature option

Signed-off-by: Jendrik Johannes <jendrik@gradle.com>

    • -1
    • +1
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 23 more files in changeset.
Adjust test exceptions for libraries published with maven

The new experimental behavior derives Java library variants for libaries

published with maven. As a result, we now select the "compile" or

"runtime" configuration/variant for dependencies that originate from a

classic maven repository (if experimental features are turned on).

Signed-off-by: Jendrik Johannes <jendrik@gradle.com>

    • -3
    • +3
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 5 more files in changeset.
Let Maven and Ivy module fixture provide java library variants

    • -5
    • +5
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 8 more files in changeset.
Do not use artifact metadata source when experimental features are enabled

    • -2
    • +0
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 4 more files in changeset.
Do not request Ivy/POM file when module metadata is used

The previous change meant that the Ivy/POM was not _used_ when

a module metadata file was found. With this change, the unusued

file is not requested when it won't be needed.

The change is trivial, but it required changes to our test

infrastructure due to the change expected requests.

    • -84
    • +4
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 8 more files in changeset.
Bump FORMAT_VERSION number for Gradle module metadata

    • -11
    • +13
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 7 more files in changeset.
Use a fixture to enable experimental features in integTests

    • -6
    • +3
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 10 more files in changeset.
Simplify control of experimental features

- Removed ability to selectively enable features via DSL

- Renamed `enableAll()` -> `enable()`

- Can still selectively enable features via System property

    • -1
    • +1
    ./MavenRemoteDependencyWithGradleMetadataResolutionIntegrationTest.groovy
  1. … 11 more files in changeset.