efegokdemir opened a new pull request, #1237: URL: https://github.com/apache/maven-plugin-tools/pull/1237
Fixes #1231. ## What - Accept the Maven 4 `onlineRequired`, `dependencyCollection`, and `dependencyResolutionPathScopes` annotation attributes during descriptor extraction. - Write path scopes to `dependencyCollection` when collection is requested, and to `dependencyResolution` otherwise. - Add Maven 4 integration coverage for each attribute. ## Why The annotation scanner dispatches attributes to same-named setters on `MojoAnnotationContent`. The missing setters made the `descriptor` goal fail when Maven 4 annotation attributes were explicitly set. The path scopes also need to be retained in the matching Maven 4 descriptor field. ## Testing - Before the fix, the `v4api-4x` integration fixture failed during descriptor generation with `Method: 'dependencyResolutionPathScopes' not found`. - After the fix, `JAVA_HOME=/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home /tmp/maven4-rc7/apache-maven-4.0.0-rc-7/bin/mvn -pl maven-plugin-plugin -am -Prun-its -Dinvoker.test=v4api-4x -DskipTests verify` — PASS; the Maven 4 `v4api-4x` integration test passed. - `JAVA_HOME=/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home /opt/homebrew/Cellar/maven/3.10.0/libexec/bin/mvn -pl maven-plugin-tools-annotations -am test` — PASS; 98 tests, no failures or errors. - `git diff --cached --check` — PASS. ## Notes AI assistance was used during preparation; the submitting contributor reviewed the changes and test results. --- - [x] I hereby declare this contribution to be licensed under the Apache License Version 2.0 (January 2004). - [ ] I hereby declare that I have filed an Apache Individual Contributor License Agreement. -- 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]
