Skip to content

Replace deprecated ArtifactRepository in PmdProjectStub - #795

Open
MaxonT wants to merge 1 commit into
apache:masterfrom
MaxonT:contrib/793-auto
Open

MaxonT wants to merge 1 commit into
apache:masterfrom
MaxonT:contrib/793-auto

Conversation

@MaxonT

@MaxonT MaxonT commented Nov 29, 2026

Copy link
Copy Markdown

The maven-pmd-plugin still calls APIs that Maven 3 deprecated, and issue #793 asks to move off them; the patch is attached for you to look over.

Description

PmdProjectStub built an ArtifactRepository (with two ArtifactRepositoryPolicy objects) in getRemoteArtifactRepositories() and converted it with RepositoryUtils.toRepos() to answer getRemoteProjectRepositories(). Nothing in the module calls getRemoteArtifactRepositories(); ConfigurationService only uses getRemoteProjectRepositories(). This change removes the deprecated override and the five imports it needed, and builds the same central repository directly as a Resolver RemoteRepository (https://repo1.maven.org/maven2, type default). The default repository policies on a RemoteRepository are enabled, daily update and warn on checksum failure, which is what new ArtifactRepositoryPolicy() gave before. One side effect: without the override, getRemoteArtifactRepositories() falls back to the test harness default, an empty list, instead of returning central; nothing in the module reads it. Only src/test is touched, so no public API, config or output changes.

Validation

mvn -B clean verify on this head: exit 0, 92 unit tests run, 0 failures, 0 errors (spotless reformatted my builder call to its own style, and that is what the diff shows). The existing tests already exercise this stub through every *ProjectStub subclass, so I did not add a new one; this is a refactor, not a behaviour fix. I did not run the build on the unchanged master for comparison, and I did not run the integration tests (-Prun-its). The build ran with JDK 23.0.2 and Maven 3.9.9 on macOS.

Closes #793. Part of apache/maven#14157.

@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown

⚠️ License declaration missing

The pull request description must contain at least one of the following lines with a checked box ([x]):

- [ ] I hereby declare this contribution to be licensed under the [Apache License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0)
- [ ] I hereby declare that I have filed an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).

This comment will be hidden automatically once the description is fixed.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move off the Maven API deprecated since Maven 3

2 participants