From 193f03e40434c6ebfb9fe861969a47ba80f06325 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 4 May 2012 10:01:39 +0000 Subject: [PATCH] expose datamodel classes for Mojo and Execute annotations git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/branches/MPLUGIN-189@1333842 13f79535-47bb-0310-9956-ffa450edef68 --- .../JavaAnnotationsMojoDescriptorExtractor.java | 5 +++-- .../annotations/scanner/MojoAnnotatedClass.java | 16 ++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/JavaAnnotationsMojoDescriptorExtractor.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/JavaAnnotationsMojoDescriptorExtractor.java index 0d0843c..c6e2a29 100644 --- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/JavaAnnotationsMojoDescriptorExtractor.java +++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/JavaAnnotationsMojoDescriptorExtractor.java @@ -25,6 +25,7 @@ import org.apache.maven.plugin.descriptor.PluginDescriptor; import org.apache.maven.project.MavenProject; import org.apache.maven.tools.plugin.DefaultPluginToolsRequest; import org.apache.maven.tools.plugin.PluginToolsRequest; +import org.apache.maven.tools.plugin.annotations.datamodel.MojoAnnotationContent; import org.apache.maven.tools.plugin.annotations.scanner.MojoAnnotatedClass; import org.apache.maven.tools.plugin.annotations.scanner.MojoAnnotationsScanner; import org.apache.maven.tools.plugin.annotations.scanner.MojoAnnotationsScannerRequest; @@ -98,12 +99,12 @@ public class JavaAnnotationsMojoDescriptorExtractor { MojoDescriptor mojoDescriptor = new MojoDescriptor(); - Mojo mojo = mojoAnnotatedClass.getMojo(); + MojoAnnotationContent mojo = mojoAnnotatedClass.getMojo(); mojoDescriptor.setAggregator( mojo.aggregator() ); mojoDescriptor.setDependencyResolutionRequired( mojo.requiresDependencyResolution() ); mojoDescriptor.setDirectInvocationOnly( mojo.requiresDirectInvocation() ); - + mojoDescriptor.setDeprecated( mojo.getDeprecated() ); mojoDescriptors.add( mojoDescriptor ); } return mojoDescriptors; diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/MojoAnnotatedClass.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/MojoAnnotatedClass.java index 6c1dc16..6ac7872 100644 --- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/MojoAnnotatedClass.java +++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/MojoAnnotatedClass.java @@ -18,9 +18,9 @@ package org.apache.maven.tools.plugin.annotations.scanner; * under the License. */ -import org.apache.maven.tools.plugin.annotations.Execute; -import org.apache.maven.tools.plugin.annotations.Mojo; import org.apache.maven.tools.plugin.annotations.datamodel.ComponentAnnotationContent; +import org.apache.maven.tools.plugin.annotations.datamodel.ExecuteAnnotationContent; +import org.apache.maven.tools.plugin.annotations.datamodel.MojoAnnotationContent; import org.apache.maven.tools.plugin.annotations.datamodel.ParameterAnnotationContent; import java.util.ArrayList; @@ -36,9 +36,9 @@ public class MojoAnnotatedClass private String parentClassName; - private Mojo mojo; + private MojoAnnotationContent mojo; - private Execute execute; + private ExecuteAnnotationContent execute; private List parameters; @@ -60,23 +60,23 @@ public class MojoAnnotatedClass return this; } - public Mojo getMojo() + public MojoAnnotationContent getMojo() { return mojo; } - public MojoAnnotatedClass setMojo( Mojo mojo ) + public MojoAnnotatedClass setMojo( MojoAnnotationContent mojo ) { this.mojo = mojo; return this; } - public Execute getExecute() + public ExecuteAnnotationContent getExecute() { return execute; } - public MojoAnnotatedClass setExecute( Execute execute ) + public MojoAnnotatedClass setExecute( ExecuteAnnotationContent execute ) { this.execute = execute; return this;