MaxonT opened a new pull request, #1296: URL: https://github.com/apache/maven-plugin-tools/pull/1296
Hi, maven-plugin-tools still had code built on Maven API that was deprecated back in Maven 3, so I moved those spots to the current calls; the diff is small enough to read in one go. ### Description `FooMojo`, a fixture in `maven-plugin-tools-annotations/src/test`, declares a `@Component(role = ArtifactMetadataSource.class, hint = "maven")` field. `ArtifactMetadataSource` is one of the Maven APIs deprecated since Maven 3 that #1295 lists. This change swaps the field for a plain `@Component RepositorySystem repositorySystem`, the replacement the issue names (Resolver's `RepositorySystem`), and drops the old import. The field only gives the extractor a component requirement to read. `JavaAnnotationsMojoDescriptorExtractorTest.assertFooMojo` and `DefaultMojoAnnotationsScannerTest.scanFooMojoClass` use `FooMojo` without asserting this field's type, role or hint (the scanner test only checks that exactly one component is found). `maven-plugin-tools-annotations` also publishes its test classes as a tests jar, and two integration tests extend `FooMojo` from it. Only `annotation-with-inheritance-from-deps` asserts the requirement, so its `verify.groovy` is updated in this PR: the role, hint and field name now match the new field, and because the plugin descriptor now lists `projectHelper` before `repositorySystem`, the two requirement indices swap. `maven-resolver-api` is already a dependency of the module, so no pom change is needed. This covers `FooMojo` and the one integration test that reads it. The two `AbstractFirstMojo` classes under `src/it` (`annotation-with-inheritance` and `annotation-with-inheritance-reactor`) and the other items in the issue (`ArtifactRepository`, `getScriptSourceRoots()`) are untouched. ### Validation `mvn -B -pl maven-plugin-tools-annotations -am test` on this head: exit 0, 44 tests run in `maven-plugin-tools-annotations`, 0 failures, 0 errors. `mvn -B -Prun-its -pl maven-plugin-plugin -am verify` with `-Dinvoker.test` set to `annotation-with-inheritance-from-deps`, and again to `mplugin-372-annotation-with-inheritance-from-provided-deps`: each exits 0 with 1 passed, 0 failed. The first run of `annotation-with-inheritance-from-deps` failed on my own first version of `verify.groovy` (wrong requirement order), which is how I found the swap. I did not run the other integration tests, did not run `mvn verify` for the whole build, and did not run any of this on unchanged `master`. The build used JDK 25 and Maven from Homebrew on macOS, so older JDK or Maven versions are not checked. Part of #1295. Part of apache/maven#14157. -- 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]
