From 0a1066ff87bd83214d37e20481dff1b20d628273 Mon Sep 17 00:00:00 2001 From: Herve Boutemy Date: Sat, 19 May 2012 20:57:43 +0000 Subject: [PATCH] [MPLUGIN-199] removed old undocumented "property" feature of javadoc tags (ie changing field name) git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@1340565 13f79535-47bb-0310-9956-ffa450edef68 --- .../extractor/java/JavaMojoAnnotation.java | 13 --------- .../java/JavaMojoDescriptorExtractor.java | 29 ++----------------- 2 files changed, 3 insertions(+), 39 deletions(-) diff --git a/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoAnnotation.java b/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoAnnotation.java index 1463e4b..baff8b8 100644 --- a/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoAnnotation.java +++ b/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoAnnotation.java @@ -309,19 +309,6 @@ public interface JavaMojoAnnotation */ String PARAMETER_IMPLEMENTATION = "implementation"; - /** - * This indicates the base name of the bean properties used to read/write this parameter's value. - *
- * Refer to @parameter property="project" - *

- * Would say there is a getProject() method and a setProject(Project) method. Here the field - * name would not be the basis for the parameter's name. This mode of operation will allow the - * mojos to be usable as beans and will be the promoted form of use. - *
- * Note: Should be defined in a Mojo Field. - */ - String PARAMETER_PROPERTY = "property"; - /** * Specifies that this parameter cannot be configured directly by the user (as in the case of POM-specified * configuration). diff --git a/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractor.java b/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractor.java index eb51174..8f69937 100644 --- a/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractor.java +++ b/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractor.java @@ -89,9 +89,6 @@ public class JavaMojoDescriptorExtractor /** @deprecated since 2.4, use {@link JavaMojoAnnotation#PARAMETER_IMPLEMENTATION} instead of. */ public static final String PARAMETER_IMPLEMENTATION = JavaMojoAnnotation.PARAMETER_IMPLEMENTATION; - /** @deprecated since 2.4, use {@link JavaMojoAnnotation#PARAMETER_PROPERTY} instead of. */ - public static final String PARAMETER_PROPERTY = JavaMojoAnnotation.PARAMETER_PROPERTY; - /** @deprecated since 2.4, use {@link JavaMojoAnnotation#REQUIRED} instead of. */ public static final String REQUIRED = JavaMojoAnnotation.REQUIRED; @@ -475,6 +472,8 @@ public class JavaMojoDescriptorExtractor Parameter pd = new Parameter(); + pd.setName( entry.getKey() ); + if ( !type.isArray() ) { pd.setType( type.getValue() ); @@ -496,6 +495,7 @@ public class JavaMojoDescriptorExtractor pd.setDescription( field.getComment() ); DocletTag componentTag = field.getTagByName( JavaMojoAnnotation.COMPONENT ); + if ( componentTag != null ) { String role = componentTag.getNamedParameter( JavaMojoAnnotation.COMPONENT_ROLE ); @@ -515,8 +515,6 @@ public class JavaMojoDescriptorExtractor pd.setRequirement( new Requirement( role, roleHint ) ); - pd.setName( entry.getKey() ); - pd.setEditable( false ); /* TODO: or better like this? Need @component fields be editable for the user? pd.setEditable( field.getTagByName( READONLY ) == null ); @@ -526,27 +524,6 @@ public class JavaMojoDescriptorExtractor { DocletTag parameter = field.getTagByName( JavaMojoAnnotation.PARAMETER ); - // ---------------------------------------------------------------------- - // We will look for a property name here first and use that if present - // i.e: - // - // @parameter property="project" - // - // Which will become the name used for the configuration element which - // will in turn will allow plexus to use the corresponding setter. - // ---------------------------------------------------------------------- - - String property = parameter.getNamedParameter( JavaMojoAnnotation.PARAMETER_PROPERTY ); - - if ( !StringUtils.isEmpty( property ) ) - { - pd.setName( property ); - } - else - { - pd.setName( entry.getKey() ); - } - pd.setRequired( field.getTagByName( JavaMojoAnnotation.REQUIRED ) != null ); pd.setEditable( field.getTagByName( JavaMojoAnnotation.READONLY ) == null );