slachiewicz opened a new issue, #1231: URL: https://github.com/apache/maven-plugin-tools/issues/1231
### Affected version 4.0.0-beta-3; the code is unchanged on master ### Bug description The scanner copies each annotation attribute set on a mojo into `MojoAnnotationContent` by calling the method of the same name ([DefaultMojoAnnotationsScanner.java:276](https://github.com/apache/maven-plugin-tools/blob/master/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/scanner/DefaultMojoAnnotationsScanner.java#L276)). [MojoAnnotationContent](https://github.com/apache/maven-plugin-tools/blob/master/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/datamodel/MojoAnnotationContent.java) has no method for three attributes of the Maven 4 API `@Mojo`, so setting any of them fails the `descriptor` goal: | Attribute | Error | |---|---| | `dependencyCollection = true` | `Method: 'dependencyCollection' not found in class: 'class org.apache.maven.tools.plugin.extractor.annotations.datamodel.MojoAnnotationContent'` | | `onlineRequired = true` | `Method: 'onlineRequired' not found in class: …` | | `dependencyResolutionPathScopes = "main-compile"` | `Method: 'dependencyResolutionPathScopes' not found in class: …` | Reproduced with maven-plugin-plugin 4.0.0-beta-3 under Maven 4.0.0-rc-7, one mojo per attribute, for example: ```java @Mojo(name = "run", dependencyCollection = true) public class ReproMojo implements org.apache.maven.api.plugin.Mojo { public void execute() {} } ``` [010c9b2e](https://github.com/apache/maven-plugin-tools/commit/010c9b2efe5a4baa264e5b9750e0bfc471590398) (MPLUGIN-508) added methods for the Maven 4 names `projectRequired` and `dependencyResolutionRequired`; these three have none. #257 (MPLUGIN-506, closed unmerged) mapped `onlineRequired`. They do not map one to one: `dependencyCollection` is a `boolean` where the Maven 3 `requiresDependencyCollection` is a `ResolutionScope`, and `dependencyResolutionPathScopes` names Maven 4 path scopes. -- 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]
