MavenFileModule.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Adjust tests and samples to new publishing default behavior

  1. … 43 more files in changeset.
Adjust tests and samples to new publishing default behavior

  1. … 16 more files in changeset.
Adjust tests and samples to new publishing default behavior

  1. … 16 more files in changeset.
Adjust tests and samples to new publishing default behavior

  1. … 16 more files in changeset.
Implement Gradle metadata marker in published pom/ivy files

This commit implements a performance optimization for Gradle metadata.

Given that today there's no library published in any repository with

Gradle metadata, it's much more likely to find a POM (or Ivy) metadata

file for an external dependency, rather than a Gradle metadata file.

If we decided to add `gradleMetadata()` sources by default to all

repositories, then we would probably introduce a performance regression

to a lot of builds, because we would first try to get Gradle metadata,

then fail, and search for POM/Ivy files.

To avoid this, whenever a library is going to be published with Gradle

metadata, we will introduce a _marker_ in the published POM or Ivy

file. When Gradle _resolves_ such a dependency, it will parse the POM

file and look for the marker. If it finds it, then it will _redirect_

to use Gradle metadata instead. This means that when Gradle metadata is

present, we will pay the price of looking for a POM or Ivy file first,

start parsing, only to discover we should parse Gradle metadata. This

should be ok in the beginning, knowing that if `gradleMetadata()` is

added, then we would systematically look at Gradle metadata first.

This means that this is a _temporary_ solution, until Gradle metadata

becomes widespread. So "temporary" should be understood as several

months, if not years.

The marker introduced in POM and Ivy files is _neutral_ for both Ivy

and Maven. By this we mean that it uses an XML comment. While not super

nice, we couldn't use a custom namespace because both Ivy and Maven

fail when parsing this. Properties were considered too, but Ivy doesn't

support them so for consistency both models use comments.

It's worth noting that we will still _completely parse_ the POM or Ivy

descriptor. It's a waste of time, but it helps in case we find a marker

but that for some reason the Gradle metadata file is absent. In this

case we fallback on the model we found.

This change also introduces a change in the semantics of the incubating

metadata sources API: those should be considered _hints_, and not strong

statements anymore.

Finally, should a producer want to avoid publishing Gradle metadata,

it's now possible to disable the task that creates the metadata file.

  1. … 57 more files in changeset.
Fixed the implementation of `MavenModule.getArtifact(path)` test fixture method.

  1. … 4 more files in changeset.
Some changes to `MavenModule` test fixtures to allow an artifact in a module to be defined using a path relative to the module directory, moved up some methods to more general interfaces, and some other tidy-ups.

  1. … 13 more files in changeset.
Added some int test coverage for interaction between Maven scopes and Ivy configurations.

  1. … 27 more files in changeset.
Converted a maven int test to use `ResolveTestFixture` to verify results.

  1. … 5 more files in changeset.
GRADLE-2762: Pulled up common code into parent class and added tests.

  1. … 4 more files in changeset.
GRADLE-2034 - handle missing artifacts in mavenLocal cache.

Implement a new MavenLocalResolver which checks for artifact

existance in the maven cache before resolving the artifact

from the cache. This is to work around the issue on

systems that are using Gradle and Maven where Maven

builds will resolve an artifact POM but not the artifact

itself.

  1. … 13 more files in changeset.
Some tweaks to AbstractModule.publish() to better deal with unchanged artifacts.

  1. … 2 more files in changeset.
Changed the contract of IvyModule and MavenModule test fixtures' publish() method so that they publish only those artifacts that have changed since last time the module was published, to allow an int test to deal with changing modules better.

  1. … 8 more files in changeset.
Changed the test repository fixtures to generate content such that the length of each artifact changes each time publishWithChangedContent() is called. Also fixed sha1 and md5 checksum generation to include leading '0'.

  1. … 6 more files in changeset.
Fix MavenFileModule.getPublishArtifactVersion() so it works for non-published modules as well

Removed the obfuscation of snapshot versions in MavenFileModule.assertArtifactsPublished() - Actual artifact names must be explicitly asserted (can use `module.publishedArtifactVersion` to get resolved snapshot version).

  1. … 4 more files in changeset.
Test the resolution of Maven projects published with the maven-publish plugin - Added resolve verification to many integ tests for Maven publishing

  1. … 8 more files in changeset.
Added convenience methods for checking state of standard MavenModule types (REVIEW-1261)

  1. … 2 more files in changeset.
REVIEW-1215: Test coverage for different maven coordinates (non-ascii, whitespace)

  1. … 2 more files in changeset.
Added check for pom 'packaging' in maven publication tests

WarPlugin now adds 'web' component, which can be published to maven repository.

  1. … 5 more files in changeset.
Some renaming and cleanup around the test/temp directory used in tests.

  1. … 308 more files in changeset.
REVIEW-839: extract root metadata handling from MavenHttpArtifact. Move verifyChecksum from MavenFileModule to HttpArtifact.

  1. … 8 more files in changeset.
fix failing ci.

Extract some pom handling from MavenHttpRepo into dedicated test fixture. Todo: extract pom put operations.

  1. … 26 more files in changeset.
REVIEW-750: Added utility assertions to MavenFileModule for assertNotPublished() and assertPublishedAsJavaModule()

  1. … 2 more files in changeset.
Some tweaks to Maven test fixtures.

  1. … 4 more files in changeset.
Changed a few more int tests to use the MavenHttpModule and IvyHttpModule fixtures.

  1. … 7 more files in changeset.
GRADLE-2364: Extend Maven related test fixtures to allow assertion on published artifacts with a classifier.

  1. … 1 more file in changeset.
Move the maven test fixtures into their own package.

    • -0
    • +332
    ./MavenFileModule.groovy
  1. … 33 more files in changeset.