slachiewicz opened a new pull request, #2275: URL: https://github.com/apache/maven-resolver/pull/2275
Part of #2272, stacked on #2274. With both, a clean `mvn install` on JDK 21 with `-Xmaxwarns 100000` prints no deprecation warning from any source set of any module; the earlier count in #2272 was low because javac stops at 100 warnings per compilation and maven-resolver-impl's test set exceeded that. What happens per kind of usage: - Tests whose subject is a deprecated class (`DefaultFileProcessorTest`, `FileUtilsTest`, `NearestVersionSelectorTest`, the node list generator, scope and optional selector tests, `PredicateVersionFilterTest`, `DefaultVersionFilterContextTest`, `LocalRepositoryTest` and the Hazelcast CP semaphore tests) are suppressed at class level and go away with the class. - Tests that exercise a deprecated path on purpose are suppressed per method with a one-line reason: the `testGetPathFor*` methods of the local repository manager tests, which assert on the relative path string that only the deprecated methods return, and the two `ContextualSnapshotVersionFilterTest` methods that cover the `CONFIG_PROP_ENABLE` key, which has no replacement. - Anonymous `LocalRepositoryManager` implementations in `DefaultArtifactResolverTest` carry `@Deprecated` on their `getPathFor*` overrides, as the main classes do in #2274. - Everything else moves to the replacement: `@TempDir` with `java.nio.file.Files` for the `TestFileUtils` temp-file helpers, `setPath`/`getPath`/`getBasePath`, `getAbsolutePathFor*`, the `Path` constructors of `LocalRepository`, `DefaultMetadata` and `TransferResource`, `ChecksumFailureException.noneAvailable`, the `UnsolvableVersionConflictException` constructor that takes a message, the `DefaultNamedLockFactorySelector` lock-wait keys, `ConfigurableVersionSelector` where `NearestVersionSelector` was incidental, and `PreorderDependencyNodeConsumerVisitor`. Assertions keep their meaning. The modules compile with `--release 8`, under which javac reports an import of a deprecated type even in a suppressed class; `DefaultFileProcessorTest` therefore names the deprecated `FileProcessor.ProgressListener` by its fully qualified name. Verified: clean `mvn install` (unit tests, no ITs) of this branch on JDK 21 (macOS) → BUILD SUCCESS, 2272 tests, 0 failures; `grep 'has been deprecated'` on the log → empty. --- - [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) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
