Skip to content

[MDEP-858] Replace Maven Artifact Transfer with Maven Resolver - #1668

Open
wilx wants to merge 4 commits into
apache:masterfrom
wilx:issue-1355-get-resolver
Open

[MDEP-858] Replace Maven Artifact Transfer with Maven Resolver#1668
wilx wants to merge 4 commits into
apache:masterfrom
wilx:issue-1355-get-resolver

Conversation

@wilx

@wilx wilx commented Aug 2, 2026

Copy link
Copy Markdown

Summary

Replace the remaining Maven Artifact Transfer usage with Maven Resolver APIs:

  • migrate dependency:get artifact and dependency resolution;
  • migrate repository-layout installation in dependency:copy-dependencies;
  • migrate dependency:purge-local-repository resolution while preserving filtering, fallback resolution, and aggregated failures;
  • extend ResolverUtil with the shared Resolver operations and remove the now-unused maven-artifact-transfer dependency and DependableCoordinate implementation.

The migration preserves custom artifact types, alternate repositories, copied POMs, snapshot base-version handling, Maven local-repository metadata, and purge fallback behavior.

Fixes #1355

Verification

  • Maven 3: mvn verify — 413 tests, 0 failures/errors, 1 skipped
  • Maven 4: mvn verify — 413 tests, 0 failures/errors, 1 skipped
  • Maven 3: full mvn -Prun-its verify — 94 passed, 0 failures/errors, 5 JRE skips
  • Maven 4: focused copy/unpack integration tests — 8 passed
  • Maven 3 and Maven 4: purge-local-repository integration tests — 11 passed on each, including the normally excluded bad-POM case

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Your pull request should address just one issue, without pulling in other changes.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body.
    Note that commits might be squashed by a maintainer on merge.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
    This may not always be possible but is a best-practice.
  • Run mvn verify to make sure basic checks pass.
    A more thorough check will be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its verify).

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

wilx added 4 commits August 2, 2026 10:03
Replace the Maven Artifact Transfer resolvers used by dependency:get while preserving repository and artifact-type behavior. Keep the component dependency for goals that still use it.

Part of apache#1355
… Resolver

Replace Maven Artifact Transfer installation used by dependency:copy-dependencies in the repository-layout path while preserving Maven local-repository metadata, copied POMs, and snapshot behavior.

Part of apache#1355
Replace the Maven Artifact Transfer resolvers while preserving dependency filtering, fallback resolution, and aggregated failure reporting. Re-resolve each artifact once because Resolver descriptor resolution also restores its POM.

Part of apache#1355
Drop the unused DependableCoordinate interface from ArtifactItem and remove the now-unused Maven Artifact Transfer dependency. Keep the artifact configuration getters unchanged.

Part of apache#1355
@wilx
wilx marked this pull request as ready for review August 2, 2026 09:43
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
* @since 1.0
*/
public class ArtifactItem implements DependableCoordinate {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably an incompatible change that requires a major version bump

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are plugin's themselves considered API? We wouldn't be able to make any changes if they were impossible to change.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Public means public. Hyrum's Law applies.

You can make changes. Just make sure they're compatible.

BuildContext buildContext,
MavenProject project,
ResolverUtil resolverUtil,
RepositoryManager repositoryManager,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

incompatible API change

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MDEP-858] Drop maven-artifact-transfer

3 participants