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
master
Olivier Lamy 2012-05-04 10:01:39 +00:00
parent 58fd600871
commit 193f03e404
2 changed files with 11 additions and 10 deletions

View File

@ -25,6 +25,7 @@ import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.apache.maven.project.MavenProject; import org.apache.maven.project.MavenProject;
import org.apache.maven.tools.plugin.DefaultPluginToolsRequest; import org.apache.maven.tools.plugin.DefaultPluginToolsRequest;
import org.apache.maven.tools.plugin.PluginToolsRequest; 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.MojoAnnotatedClass;
import org.apache.maven.tools.plugin.annotations.scanner.MojoAnnotationsScanner; import org.apache.maven.tools.plugin.annotations.scanner.MojoAnnotationsScanner;
import org.apache.maven.tools.plugin.annotations.scanner.MojoAnnotationsScannerRequest; import org.apache.maven.tools.plugin.annotations.scanner.MojoAnnotationsScannerRequest;
@ -98,12 +99,12 @@ public class JavaAnnotationsMojoDescriptorExtractor
{ {
MojoDescriptor mojoDescriptor = new MojoDescriptor(); MojoDescriptor mojoDescriptor = new MojoDescriptor();
Mojo mojo = mojoAnnotatedClass.getMojo(); MojoAnnotationContent mojo = mojoAnnotatedClass.getMojo();
mojoDescriptor.setAggregator( mojo.aggregator() ); mojoDescriptor.setAggregator( mojo.aggregator() );
mojoDescriptor.setDependencyResolutionRequired( mojo.requiresDependencyResolution() ); mojoDescriptor.setDependencyResolutionRequired( mojo.requiresDependencyResolution() );
mojoDescriptor.setDirectInvocationOnly( mojo.requiresDirectInvocation() ); mojoDescriptor.setDirectInvocationOnly( mojo.requiresDirectInvocation() );
mojoDescriptor.setDeprecated( mojo.getDeprecated() );
mojoDescriptors.add( mojoDescriptor ); mojoDescriptors.add( mojoDescriptor );
} }
return mojoDescriptors; return mojoDescriptors;

View File

@ -18,9 +18,9 @@ package org.apache.maven.tools.plugin.annotations.scanner;
* under the License. * 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.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 org.apache.maven.tools.plugin.annotations.datamodel.ParameterAnnotationContent;
import java.util.ArrayList; import java.util.ArrayList;
@ -36,9 +36,9 @@ public class MojoAnnotatedClass
private String parentClassName; private String parentClassName;
private Mojo mojo; private MojoAnnotationContent mojo;
private Execute execute; private ExecuteAnnotationContent execute;
private List<ParameterAnnotationContent> parameters; private List<ParameterAnnotationContent> parameters;
@ -60,23 +60,23 @@ public class MojoAnnotatedClass
return this; return this;
} }
public Mojo getMojo() public MojoAnnotationContent getMojo()
{ {
return mojo; return mojo;
} }
public MojoAnnotatedClass setMojo( Mojo mojo ) public MojoAnnotatedClass setMojo( MojoAnnotationContent mojo )
{ {
this.mojo = mojo; this.mojo = mojo;
return this; return this;
} }
public Execute getExecute() public ExecuteAnnotationContent getExecute()
{ {
return execute; return execute;
} }
public MojoAnnotatedClass setExecute( Execute execute ) public MojoAnnotatedClass setExecute( ExecuteAnnotationContent execute )
{ {
this.execute = execute; this.execute = execute;
return this; return this;