Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.5
-
None
Description
<dependencies> <!-- dependencies to annotations --> <dependency> <groupId>org.apache.maven.plugin-tools</groupId> <artifactId>maven-plugin-annotations</artifactId> <version>3.5</version> <scope>provided</scope><!-- annotations are needed only to build the plugin --> </dependency> </dependencies>
Yes, annotations are needed only to build the plugin, since they have @Retention(value=CLASS) which means they stay in bytecode but are not loaded at runtime.
What is not clear is that this dependency is not really provided at runtime: Maven core does not inject maven-plugin-annotations at runtime (why would it? Maven core works by reading META-INF/maven/plugin.xml). But the dependency is simply not used at runtime.
This doc can be improved:
<!-- annotations are not used at runtime because @Retention(value=CLASS), they are needed only to build the plugin -->
Attachments
Issue Links
- relates to
-
MNG-6135 Maven plugins and core extensions are not dependencies, they should be resolved the same way as projects.
- Reopened
-
MRESOLVER-8 ScopeDependencySelector incorrectly de-selects direct dependencies
- Reopened
-
MPLUGIN-296 java.lang.ClassNotFoundException: org.apache.maven.plugins.annotations.Execute
- Closed