diff --git a/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Component.java b/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Component.java index b132524..2008170 100644 --- a/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Component.java +++ b/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Component.java @@ -39,4 +39,8 @@ public @interface Component String role() default ""; String roleHint() default ""; + + boolean required() default false; + + boolean readonly() default false; } 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 b81c8fb..043ed11 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 @@ -516,6 +516,9 @@ public class JavaAnnotationsMojoDescriptorExtractor parameter.setEditable( false ); parameter.setDeprecated( componentAnnotationContent.getDeprecated() ); parameter.setSince( componentAnnotationContent.getSince() ); + // same behaviour as JavaMojoDescriptorExtractor + //parameter.setRequired( componentAnnotationContent.required() ); + parameter.setEditable( false ); mojoDescriptor.addParameter( parameter ); } diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/datamodel/ComponentAnnotationContent.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/datamodel/ComponentAnnotationContent.java index b649a3b..0543b49 100644 --- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/datamodel/ComponentAnnotationContent.java +++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/datamodel/ComponentAnnotationContent.java @@ -35,6 +35,10 @@ public class ComponentAnnotationContent private String roleHint; + private boolean required = false; + + private boolean readonly = false; + public ComponentAnnotationContent( String fieldName ) { super( fieldName ); @@ -72,6 +76,26 @@ public class ComponentAnnotationContent return null; } + public boolean required() + { + return required; + } + + public void required( boolean required ) + { + this.required = required; + } + + public boolean readonly() + { + return readonly; + } + + public void readonly( boolean readonly ) + { + this.readonly = readonly; + } + @Override public String toString() {