From 28a6f546434645271d970736154c328d910a9e50 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 4 May 2012 10:05:16 +0000 Subject: [PATCH] revert back phase change help generation with doclet must continue to work git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/branches/MPLUGIN-189@1333850 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/plugins/annotations/Mojo.java | 2 +- .../src/it/help-basic/invoker.properties | 2 +- .../apache/maven/plugin/coreit/FirstMojo.java | 3 + .../it/java-basic-annotations/verify.groovy | 48 +++++----- .../plugin/DescriptorGeneratorMojo.java | 2 +- .../plugin/plugin/HelpGeneratorMojo.java | 2 +- ...avaAnnotationsMojoDescriptorExtractor.java | 94 ++++++++++++++++++- .../datamodel/MojoAnnotationContent.java | 4 +- .../datamodel/ParameterAnnotationContent.java | 19 +++- .../DefaultMojoAnnotationsScanner.java | 8 +- .../scanner/MojoAnnotatedClass.java | 26 +++-- .../scanner/visitors/MojoClassVisitor.java | 3 +- .../scanner/visitors/MojoFieldVisitor.java | 15 ++- .../tools/plugin/annotations/FooMojo.java | 2 +- .../annotations/TestAnnotationsReader.java | 10 +- 15 files changed, 186 insertions(+), 54 deletions(-) diff --git a/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Mojo.java b/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Mojo.java index c102b29..3eef3c8 100644 --- a/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Mojo.java +++ b/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Mojo.java @@ -42,7 +42,7 @@ public @interface Mojo String requiresDependencyResolution() default "runtime"; - String requiresDependencyCollection() default "runtime"; + String requiresDependencyCollection() default ""; String instantiationStrategy() default "per-lookup"; diff --git a/maven-plugin-plugin/src/it/help-basic/invoker.properties b/maven-plugin-plugin/src/it/help-basic/invoker.properties index 5b282bb..241f018 100644 --- a/maven-plugin-plugin/src/it/help-basic/invoker.properties +++ b/maven-plugin-plugin/src/it/help-basic/invoker.properties @@ -1,2 +1,2 @@ -invoker.goals.1 = install +invoker.goals.1 = install -DskipTests invoker.goals.2 = org.apache.maven.its.plugin:help:1.0:help diff --git a/maven-plugin-plugin/src/it/java-basic-annotations/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java b/maven-plugin-plugin/src/it/java-basic-annotations/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java index cee401d..f7c64fd 100644 --- a/maven-plugin-plugin/src/it/java-basic-annotations/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java +++ b/maven-plugin-plugin/src/it/java-basic-annotations/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java @@ -41,6 +41,9 @@ public class FirstMojo extends AbstractMojo { + /** + * Project directory. + */ @Parameter( defaultValue = "${basedir}", readonly = true ) private File basedir; diff --git a/maven-plugin-plugin/src/it/java-basic-annotations/verify.groovy b/maven-plugin-plugin/src/it/java-basic-annotations/verify.groovy index 3d274c5..ef33aa5 100644 --- a/maven-plugin-plugin/src/it/java-basic-annotations/verify.groovy +++ b/maven-plugin-plugin/src/it/java-basic-annotations/verify.groovy @@ -40,29 +40,35 @@ assert mojo.requirements.requirement[0].'field-name'.text() == 'projectHelper' assert mojo.parameters.parameter.size() == 3 -assert mojo.parameters.parameter[0].name.text() == 'aliasedParam' -assert mojo.parameters.parameter[0].alias.text() == 'alias' -assert mojo.parameters.parameter[0].type.text() == 'java.lang.String' -assert mojo.parameters.parameter[0].deprecated.text() == 'As of 0.2' -assert mojo.parameters.parameter[0].required.text() == 'false' -assert mojo.parameters.parameter[0].editable.text() == 'true' -assert mojo.parameters.parameter[0].description.text() == '' +def parameter = mojo.parameters.parameter.findAll{ it.name.text() == "aliasedParam"}[0] -assert mojo.parameters.parameter[1].name.text() == 'basedir' -assert mojo.parameters.parameter[1].alias.isEmpty() -assert mojo.parameters.parameter[1].type.text() == 'java.io.File' -assert mojo.parameters.parameter[1].deprecated.isEmpty() -assert mojo.parameters.parameter[1].required.text() == 'false' -assert mojo.parameters.parameter[1].editable.text() == 'false' -assert mojo.parameters.parameter[1].description.text() == 'Project directory.' +assert parameter.name.text() == 'aliasedParam' +assert parameter.alias.text() == 'alias' +assert parameter.type.text() == 'java.lang.String' +assert parameter.deprecated.text() == 'As of 0.2' +assert parameter.required.text() == 'false' +assert parameter.editable.text() == 'true' +assert parameter.description.text() == '' -assert mojo.parameters.parameter[2].name.text() == 'touchFile' -assert mojo.parameters.parameter[2].alias.isEmpty() -assert mojo.parameters.parameter[2].type.text() == 'java.io.File' -assert mojo.parameters.parameter[2].deprecated.isEmpty() -assert mojo.parameters.parameter[2].required.text() == 'true' -assert mojo.parameters.parameter[2].editable.text() == 'true' -assert mojo.parameters.parameter[2].description.text() == '' +parameter = mojo.parameters.parameter.findAll{ it.name.text() == "touchFile"}[0] + +assert parameter.name.text() == 'touchFile' +assert parameter.alias.isEmpty() +assert parameter.type.text() == 'java.io.File' +assert parameter.deprecated.isEmpty() +assert parameter.required.text() == 'true' +assert parameter.editable.text() == 'true' +assert parameter.description.text() == '' + +parameter = mojo.parameters.parameter.findAll{ it.name.text() == "basedir"}[0] + +assert parameter.name.text() == 'basedir' +assert parameter.alias.isEmpty() +assert parameter.type.text() == 'java.io.File' +assert parameter.deprecated.isEmpty() +assert parameter.required.text() == 'false' +assert parameter.editable.text() == 'false' +assert parameter.description.text() == 'Project directory.' mojo = pluginDescriptor.mojos.mojo.findAll{ it.goal.text() == "second"}[0] diff --git a/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java b/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java index a125363..9c63dd3 100644 --- a/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java +++ b/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java @@ -34,7 +34,7 @@ import java.io.File; * @version $Id$ * @since 2.0 * @goal descriptor - * @phase process-classes + * @phase generate-resources * @requiresDependencyResolution runtime */ public class DescriptorGeneratorMojo diff --git a/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/HelpGeneratorMojo.java b/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/HelpGeneratorMojo.java index bf20432..1bac881 100644 --- a/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/HelpGeneratorMojo.java +++ b/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/HelpGeneratorMojo.java @@ -32,7 +32,7 @@ import org.apache.maven.tools.plugin.generator.PluginHelpGenerator; * @version $Id$ * @since 2.4 * @goal helpmojo - * @phase process-classes + * @phase generate-sources */ public class HelpGeneratorMojo extends AbstractGeneratorMojo 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 d53ee08..8a35a0f 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 @@ -21,6 +21,7 @@ package org.apache.maven.tools.plugin.annotations; import com.thoughtworks.qdox.JavaDocBuilder; import com.thoughtworks.qdox.model.DocletTag; import com.thoughtworks.qdox.model.JavaClass; +import com.thoughtworks.qdox.model.JavaField; import org.apache.maven.artifact.DependencyResolutionRequiredException; import org.apache.maven.plugin.descriptor.DuplicateParameterException; import org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException; @@ -49,6 +50,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.TreeMap; /** * @author Olivier Lamy @@ -124,6 +126,48 @@ public class JavaAnnotationsMojoDescriptorExtractor { entry.getValue().getMojo().setDeprecated( deprecated.getValue() ); } + + Map fieldsMap = extractFieldParameterTags( javaClass ); + for ( Map.Entry parameter : entry.getValue().getParameters().entrySet() ) + { + JavaField javaField = fieldsMap.get( parameter.getKey() ); + if ( javaField != null ) + { + ParameterAnnotationContent parameterAnnotationContent = parameter.getValue(); + deprecated = javaField.getTagByName( "deprecated" ); + if ( deprecated != null ) + { + parameterAnnotationContent.setDeprecated( deprecated.getValue() ); + } + since = javaField.getTagByName( "since" ); + if ( since != null ) + { + parameterAnnotationContent.setSince( since.getValue() ); + } + parameterAnnotationContent.setDescription( javaField.getComment() ); + } + } + + for ( Map.Entry component : entry.getValue().getComponents().entrySet() ) + { + JavaField javaField = fieldsMap.get( component.getKey() ); + if ( javaField != null ) + { + ComponentAnnotationContent componentAnnotationContent = component.getValue(); + deprecated = javaField.getTagByName( "deprecated" ); + if ( deprecated != null ) + { + componentAnnotationContent.setDeprecated( deprecated.getValue() ); + } + since = javaField.getTagByName( "since" ); + if ( since != null ) + { + componentAnnotationContent.setSince( since.getValue() ); + } + componentAnnotationContent.setDescription( javaField.getComment() ); + } + } + } } @@ -151,6 +195,41 @@ public class JavaAnnotationsMojoDescriptorExtractor return tag; } + /** + * extract fields that are either parameters or components. + * + * @param javaClass not null + * @return map with Mojo parameters names as keys + */ + private Map extractFieldParameterTags( JavaClass javaClass ) + { + Map rawParams; + + // we have to add the parent fields first, so that they will be overwritten by the local fields if + // that actually happens... + JavaClass superClass = javaClass.getSuperJavaClass(); + + if ( superClass != null ) + { + rawParams = extractFieldParameterTags( superClass ); + } + else + { + rawParams = new TreeMap(); + } + + JavaField[] classFields = javaClass.getFields(); + + if ( classFields != null ) + { + for ( JavaField field : classFields ) + { + rawParams.put( field.getName(), field ); + } + } + return rawParams; + } + protected Map discoverClasses( final PluginToolsRequest request ) { JavaDocBuilder builder = new JavaDocBuilder(); @@ -208,6 +287,12 @@ public class JavaAnnotationsMojoDescriptorExtractor List mojoDescriptors = new ArrayList( mojoAnnotatedClasses.size() ); for ( MojoAnnotatedClass mojoAnnotatedClass : mojoAnnotatedClasses.values() ) { + // no mojo so skip it + if ( mojoAnnotatedClass.getMojo() == null ) + { + continue; + } + ExtendedMojoDescriptor mojoDescriptor = new ExtendedMojoDescriptor(); //mojoDescriptor.setRole( mojoAnnotatedClass.getClassName() ); @@ -223,6 +308,8 @@ public class JavaAnnotationsMojoDescriptorExtractor mojoDescriptor.setAggregator( mojo.aggregator() ); mojoDescriptor.setDependencyResolutionRequired( mojo.requiresDependencyResolution() ); + mojoDescriptor.setDependencyCollectionRequired( mojo.requiresDependencyCollection() ); + mojoDescriptor.setDirectInvocationOnly( mojo.requiresDirectInvocation() ); mojoDescriptor.setDeprecated( mojo.getDeprecated() ); mojoDescriptor.setThreadSafe( mojo.threadSafe() ); @@ -245,7 +332,7 @@ public class JavaAnnotationsMojoDescriptorExtractor mojoDescriptor.setPhase( mojo.defaultPhase().id() ); - for ( ParameterAnnotationContent parameterAnnotationContent : mojoAnnotatedClass.getParameters() ) + for ( ParameterAnnotationContent parameterAnnotationContent : mojoAnnotatedClass.getParameters().values() ) { org.apache.maven.plugin.descriptor.Parameter parameter = new org.apache.maven.plugin.descriptor.Parameter(); @@ -256,10 +343,13 @@ public class JavaAnnotationsMojoDescriptorExtractor parameter.setDescription( parameterAnnotationContent.getDescription() ); parameter.setEditable( !parameterAnnotationContent.readonly() ); parameter.setExpression( parameterAnnotationContent.expression() ); + parameter.setType( parameterAnnotationContent.getClassName() ); + parameter.setRequired( parameterAnnotationContent.required() ); + mojoDescriptor.addParameter( parameter ); } - for ( ComponentAnnotationContent componentAnnotationContent : mojoAnnotatedClass.getComponents() ) + for ( ComponentAnnotationContent componentAnnotationContent : mojoAnnotatedClass.getComponents().values() ) { org.apache.maven.plugin.descriptor.Parameter parameter = new org.apache.maven.plugin.descriptor.Parameter(); diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/datamodel/MojoAnnotationContent.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/datamodel/MojoAnnotationContent.java index f01e7ec..ea70331 100644 --- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/datamodel/MojoAnnotationContent.java +++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/datamodel/MojoAnnotationContent.java @@ -37,7 +37,7 @@ public class MojoAnnotationContent private String requiresDependencyResolution = "runtime"; - private String requiresDependencyCollection = "runtime"; + private String requiresDependencyCollection; private String instantiationStrategy = "per-lookup"; @@ -86,7 +86,7 @@ public class MojoAnnotationContent public String requiresDependencyCollection() { - return requiresDependencyCollection; + return requiresDependencyCollection == null ? "" : requiresDependencyCollection; } public void requiresDependencyCollection( String requiresDependencyCollection ) diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/datamodel/ParameterAnnotationContent.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/datamodel/ParameterAnnotationContent.java index 0f6062f..82a82bd 100644 --- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/datamodel/ParameterAnnotationContent.java +++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/datamodel/ParameterAnnotationContent.java @@ -41,15 +41,18 @@ public class ParameterAnnotationContent private boolean readonly = false; - public ParameterAnnotationContent( String fieldName ) + private String className; + + public ParameterAnnotationContent( String fieldName, String className ) { super( fieldName ); + this.className = className; } public ParameterAnnotationContent( String fieldName, String alias, String expression, String defaultValue, - boolean required, boolean readonly ) + boolean required, boolean readonly, String className ) { - this( fieldName ); + this( fieldName, className ); this.alias = alias; this.expression = expression; this.defaultValue = defaultValue; @@ -112,6 +115,16 @@ public class ParameterAnnotationContent return null; } + public String getClassName() + { + return className; + } + + public void setClassName( String className ) + { + this.className = className; + } + @Override public String toString() { diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/DefaultMojoAnnotationsScanner.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/DefaultMojoAnnotationsScanner.java index 71bbd39..e3301d1 100644 --- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/DefaultMojoAnnotationsScanner.java +++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/DefaultMojoAnnotationsScanner.java @@ -173,7 +173,7 @@ public class DefaultMojoAnnotationsScanner for ( MojoFieldVisitor mojoFieldVisitor : mojoFieldVisitors ) { ParameterAnnotationContent parameterAnnotationContent = - new ParameterAnnotationContent( mojoFieldVisitor.getFieldName() ); + new ParameterAnnotationContent( mojoFieldVisitor.getFieldName(), mojoFieldVisitor.getClassName() ); if ( mojoFieldVisitor.getMojoAnnotationVisitor() != null ) { for ( Map.Entry entry : mojoFieldVisitor.getMojoAnnotationVisitor().getAnnotationValues().entrySet() ) @@ -183,7 +183,8 @@ public class DefaultMojoAnnotationsScanner } } - mojoClassVisitor.getMojoAnnotatedClass().getParameters().add( parameterAnnotationContent ); + mojoClassVisitor.getMojoAnnotatedClass().getParameters().put( parameterAnnotationContent.getFieldName(), + parameterAnnotationContent ); } mojoFieldVisitors = mojoClassVisitor.findFieldWithAnnotationClass( Component.class.getName() ); @@ -202,7 +203,8 @@ public class DefaultMojoAnnotationsScanner } } - mojoClassVisitor.getMojoAnnotatedClass().getComponents().add( componentAnnotationContent ); + mojoClassVisitor.getMojoAnnotatedClass().getComponents().put( componentAnnotationContent.getFieldName(), + componentAnnotationContent ); } } 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 6ac7872..2cc65d2 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 @@ -23,8 +23,8 @@ import org.apache.maven.tools.plugin.annotations.datamodel.ExecuteAnnotationCont import org.apache.maven.tools.plugin.annotations.datamodel.MojoAnnotationContent; import org.apache.maven.tools.plugin.annotations.datamodel.ParameterAnnotationContent; -import java.util.ArrayList; -import java.util.List; +import java.util.HashMap; +import java.util.Map; /** * @author Olivier Lamy @@ -40,9 +40,15 @@ public class MojoAnnotatedClass private ExecuteAnnotationContent execute; - private List parameters; + /** + * key is field name + */ + private Map parameters; - private List components; + /** + * key is field name + */ + private Map components; public MojoAnnotatedClass() { @@ -82,31 +88,31 @@ public class MojoAnnotatedClass return this; } - public List getParameters() + public Map getParameters() { if ( this.parameters == null ) { - this.parameters = new ArrayList(); + this.parameters = new HashMap(); } return parameters; } - public MojoAnnotatedClass setParameters( List parameters ) + public MojoAnnotatedClass setParameters( Map parameters ) { this.parameters = parameters; return this; } - public List getComponents() + public Map getComponents() { if ( this.components == null ) { - this.components = new ArrayList(); + this.components = new HashMap(); } return components; } - public MojoAnnotatedClass setComponents( List components ) + public MojoAnnotatedClass setComponents( Map components ) { this.components = components; return this; diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/visitors/MojoClassVisitor.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/visitors/MojoClassVisitor.java index fe2178a..5cec4b0 100644 --- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/visitors/MojoClassVisitor.java +++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/visitors/MojoClassVisitor.java @@ -124,9 +124,8 @@ public class MojoClassVisitor public FieldVisitor visitField( int access, String name, String desc, String signature, Object value ) { - // Type.getType( desc ).getClassName() logger.debug( "MojoClassVisitor#visitField" ); - MojoFieldVisitor mojoFieldVisitor = new MojoFieldVisitor( logger, name ); + MojoFieldVisitor mojoFieldVisitor = new MojoFieldVisitor( logger, name, Type.getType( desc ).getClassName() ); fieldVisitors.add( mojoFieldVisitor ); return mojoFieldVisitor; } diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/visitors/MojoFieldVisitor.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/visitors/MojoFieldVisitor.java index 2b704a0..2b82907 100644 --- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/visitors/MojoFieldVisitor.java +++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/visitors/MojoFieldVisitor.java @@ -38,10 +38,13 @@ public class MojoFieldVisitor private MojoAnnotationVisitor mojoAnnotationVisitor; - MojoFieldVisitor( Logger logger, String fieldName ) + private String className; + + MojoFieldVisitor( Logger logger, String fieldName, String className ) { this.logger = logger; this.fieldName = fieldName; + this.className = className; } public MojoAnnotationVisitor getMojoAnnotationVisitor() @@ -75,4 +78,14 @@ public class MojoFieldVisitor { logger.debug( "MojoFieldVisitor#visitEnd" ); } + + public String getClassName() + { + return className; + } + + public void setClassName( String className ) + { + this.className = className; + } } diff --git a/maven-plugin-tools-annotations/src/test/java/org/apache/maven/tools/plugin/annotations/FooMojo.java b/maven-plugin-tools-annotations/src/test/java/org/apache/maven/tools/plugin/annotations/FooMojo.java index 765cc53..a10181c 100644 --- a/maven-plugin-tools-annotations/src/test/java/org/apache/maven/tools/plugin/annotations/FooMojo.java +++ b/maven-plugin-tools-annotations/src/test/java/org/apache/maven/tools/plugin/annotations/FooMojo.java @@ -35,7 +35,7 @@ import org.apache.maven.plugins.annotations.Parameter; public class FooMojo extends AbstractMojo { - @Parameter( expression = "${thebar}" ) + @Parameter( expression = "${thebar}", required = true) private String bar; @Parameter( expression = "${thebeer}" ) diff --git a/maven-plugin-tools-annotations/src/test/java/org/apache/maven/tools/plugin/annotations/TestAnnotationsReader.java b/maven-plugin-tools-annotations/src/test/java/org/apache/maven/tools/plugin/annotations/TestAnnotationsReader.java index 12b0a15..8856e90 100644 --- a/maven-plugin-tools-annotations/src/test/java/org/apache/maven/tools/plugin/annotations/TestAnnotationsReader.java +++ b/maven-plugin-tools-annotations/src/test/java/org/apache/maven/tools/plugin/annotations/TestAnnotationsReader.java @@ -32,8 +32,8 @@ import org.fest.assertions.Assertions; import java.io.File; import java.util.Arrays; +import java.util.Collection; import java.util.Collections; -import java.util.List; import java.util.Map; /** @@ -75,12 +75,12 @@ public class TestAnnotationsReader assertEquals( "my-lifecycle", execute.lifecycle() ); assertEquals( LifecyclePhase.PACKAGE, execute.phase() ); - List components = mojoAnnotatedClass.getComponents(); + Collection components = mojoAnnotatedClass.getComponents().values(); Assertions.assertThat( components ).isNotNull().isNotEmpty().hasSize( 2 ); - List parameters = mojoAnnotatedClass.getParameters(); + Collection parameters = mojoAnnotatedClass.getParameters().values(); Assertions.assertThat( parameters ).isNotNull().isNotEmpty().hasSize( 2 ).contains( - new ParameterAnnotationContent( "bar", null, "${thebar}", null, false, false ), - new ParameterAnnotationContent( "beer", null, "${thebeer}", null, false, false ) ); + new ParameterAnnotationContent( "bar", null, "${thebar}", null, true, false, String.class.getName() ), + new ParameterAnnotationContent( "beer", null, "${thebeer}", null, false, false, String.class.getName() ) ); } }