From 640ee60806fb3dd950abacfb1e6ecc9d4f5c7a05 Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Thu, 12 May 2005 00:06:54 +0000 Subject: [PATCH] remove more deprecated stuff, improve plugin xdoc generation git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@169734 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/plugin/descriptor/Parameter.java | 34 +---- .../descriptor/PluginDescriptorBuilder.java | 2 - .../tools/plugin/generator/BeanGenerator.java | 4 +- .../tools/plugin/generator/Generator.java | 3 +- .../generator/PluginDescriptorGenerator.java | 5 +- .../plugin/generator/PluginXdocGenerator.java | 143 ++++++++---------- .../jelly/JellyHarnessGenerator.java | 2 +- .../generator/AbstractGeneratorTestCase.java | 4 +- .../maven/tools/plugin/pluggy/Main.java | 2 +- .../plugin/plugin/AbstractGeneratorMojo.java | 5 +- .../plugin/plugin/BeanGeneratorMojo.java | 6 +- .../plugin/DescriptorGeneratorMojo.java | 6 +- .../plugin/plugin/JellyGeneratorMojo.java | 6 +- .../plugin/plugin/XdocGeneratorMojo.java | 47 ++++++ .../tags/MojoDefinitionTagLibrary.java | 1 - .../marmalade/tags/ParamValidatorTag.java | 34 ----- .../script/marmalade/tags/ParameterTag.java | 12 -- 17 files changed, 136 insertions(+), 180 deletions(-) create mode 100644 maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/XdocGeneratorMojo.java delete mode 100644 maven-script/maven-script-marmalade/src/main/java/org/apache/maven/script/marmalade/tags/ParamValidatorTag.java diff --git a/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/Parameter.java b/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/Parameter.java index d74193d377..57156b085d 100644 --- a/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/Parameter.java +++ b/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/Parameter.java @@ -23,23 +23,19 @@ package org.apache.maven.plugin.descriptor; public class Parameter { private String alias; - + private String name; private String type; private boolean required; - - private boolean editable = true; - private String validator; + private boolean editable = true; private String description; private String expression; - private String defaultValue; - private String deprecated; // ---------------------------------------------------------------------- @@ -76,16 +72,6 @@ public class Parameter this.required = required; } - public String getValidator() - { - return validator; - } - - public void setValidator( String validator ) - { - this.validator = validator; - } - public String getDescription() { return description; @@ -106,16 +92,6 @@ public class Parameter this.expression = expression; } - public String getDefaultValue() - { - return defaultValue; - } - - public void setDefaultValue( String defaultValue ) - { - this.defaultValue = defaultValue; - } - public String getDeprecated() { return deprecated; @@ -131,9 +107,9 @@ public class Parameter return name.hashCode(); } - public boolean equals(Object other) + public boolean equals( Object other ) { - return (other instanceof Parameter) && getName().equals(((Parameter)other).getName()); + return ( other instanceof Parameter ) && getName().equals( ( (Parameter) other ).getName() ); } public String getAlias() @@ -155,7 +131,7 @@ public class Parameter { this.editable = editable; } - + public String toString() { return "Mojo parameter [name: \'" + getName() + "\'; alias: \'" + getAlias() + "\']"; diff --git a/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilder.java b/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilder.java index dd5cfd5ba3..ba76c6914a 100755 --- a/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilder.java +++ b/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilder.java @@ -187,8 +187,6 @@ public class PluginDescriptorBuilder parameter.setEditable( editable == null || Boolean.valueOf( editable ).booleanValue() ); } - parameter.setValidator( d.getChild( "validator" ).getValue() ); - parameter.setDescription( d.getChild( "description" ).getValue() ); parameter.setExpression( d.getChild( "expression" ).getValue() ); diff --git a/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/BeanGenerator.java b/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/BeanGenerator.java index fc97be170b..d310bdc67a 100644 --- a/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/BeanGenerator.java +++ b/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/BeanGenerator.java @@ -43,7 +43,7 @@ import java.util.List; public class BeanGenerator implements Generator { - public void execute( String destinationDirectory, PluginDescriptor pluginDescriptor ) + public void execute( File destinationDirectory, PluginDescriptor pluginDescriptor ) throws IOException { for ( Iterator it = pluginDescriptor.getMojos().iterator(); it.hasNext(); ) @@ -53,7 +53,7 @@ public class BeanGenerator } } - protected void processPluginDescriptor( MojoDescriptor descriptor, String destinationDirectory ) + protected void processPluginDescriptor( MojoDescriptor descriptor, File destinationDirectory ) throws IOException { String implementation = descriptor.getImplementation(); diff --git a/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/Generator.java b/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/Generator.java index 5f0c6d450c..c1d97207b9 100644 --- a/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/Generator.java +++ b/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/Generator.java @@ -19,6 +19,7 @@ package org.apache.maven.tools.plugin.generator; import org.apache.maven.plugin.descriptor.PluginDescriptor; import java.io.IOException; +import java.io.File; /** * @author Jason van Zyl @@ -26,6 +27,6 @@ import java.io.IOException; */ public interface Generator { - void execute( String destinationDirectory, PluginDescriptor pluginDescriptor ) + void execute( File destinationDirectory, PluginDescriptor pluginDescriptor ) throws IOException; } \ No newline at end of file diff --git a/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginDescriptorGenerator.java b/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginDescriptorGenerator.java index 5e2724c1c8..9b2cd45da3 100644 --- a/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginDescriptorGenerator.java +++ b/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginDescriptorGenerator.java @@ -43,7 +43,7 @@ import java.util.Map; public class PluginDescriptorGenerator implements Generator { - public void execute( String destinationDirectory, PluginDescriptor pluginDescriptor ) + public void execute( File destinationDirectory, PluginDescriptor pluginDescriptor ) throws IOException { File f = new File( destinationDirectory, "plugin.xml" ); @@ -257,9 +257,6 @@ public class PluginDescriptorGenerator element( w, "deprecated", parameter.getDeprecated() ); } - // TODO: do we still need this? - element( w, "validator", parameter.getValidator() ); - element( w, "required", Boolean.toString( parameter.isRequired() ) ); element( w, "editable", Boolean.toString( parameter.isEditable() ) ); diff --git a/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java b/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java index 28881ccb97..0aaedcba6c 100644 --- a/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java +++ b/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java @@ -33,23 +33,23 @@ import java.util.Map; /** * @todo add example usage tag that can be shown in the doco - * @todo need to add validation directives so that systems embedding maven2 can - * get validation directives to help users in IDEs. */ public class PluginXdocGenerator implements Generator { - public void execute( String destinationDirectory, PluginDescriptor pluginDescriptor ) + public void execute( File destinationDirectory, PluginDescriptor pluginDescriptor ) throws IOException { + // TODO: write an overview page + for ( Iterator it = pluginDescriptor.getMojos().iterator(); it.hasNext(); ) { MojoDescriptor descriptor = (MojoDescriptor) it.next(); - processPluginDescriptor( descriptor, destinationDirectory ); + processMojoDescriptor( descriptor, destinationDirectory ); } } - protected void processPluginDescriptor( MojoDescriptor mojoDescriptor, String destinationDirectory ) + protected void processMojoDescriptor( MojoDescriptor mojoDescriptor, File destinationDirectory ) throws IOException { String id = mojoDescriptor.getGoal(); @@ -57,7 +57,7 @@ public class PluginXdocGenerator FileWriter writer = null; try { - writer = new FileWriter( new File( destinationDirectory, id + "-plugin.xml" ) ); + writer = new FileWriter( new File( destinationDirectory, id + "-mojo.xml" ) ); writeBody( writer, id, mojoDescriptor ); @@ -83,15 +83,8 @@ public class PluginXdocGenerator w.startElement( "title" ); - w.writeText( "Documentation for the " + id + " plugin." ); - - w.endElement(); - - w.startElement( "author" ); - - w.addAttribute( "email", "dev@maven.apache.org" ); - - w.writeText( "Maven development team." ); + // TODO: need a friendly name for a plugin + w.writeText( mojoDescriptor.getPluginDescriptor().getArtifactId() + " - " + mojoDescriptor.getFullGoalName() ); w.endElement(); @@ -103,34 +96,24 @@ public class PluginXdocGenerator w.startElement( "section" ); - w.addAttribute( "name", "Goals" ); + w.addAttribute( "name", mojoDescriptor.getFullGoalName() ); w.startElement( "p" ); - w.writeText( "The goals for the " + id + " are as follows:" ); - - w.endElement(); - - // ---------------------------------------------------------------------- - // - // ---------------------------------------------------------------------- - - w.startElement( "subsection" ); - - w.addAttribute( "name", mojoDescriptor.getGoal() ); - if ( mojoDescriptor.getDescription() != null ) { - w.startElement( "p" ); - - w.writeText( mojoDescriptor.getDescription() ); - - w.endElement(); + w.writeMarkup( mojoDescriptor.getDescription() ); } + else + { + w.writeText( "No description." ); + } + + w.endElement(); w.startElement( "p" ); - w.writeText( "These parameters for this goal: " ); + w.writeText( "Parameters for the goal: " ); w.endElement(); @@ -138,23 +121,11 @@ public class PluginXdocGenerator w.endElement(); - // ---------------------------------------------------------------------- - // - // ---------------------------------------------------------------------- - - w.endElement(); - - // ---------------------------------------------------------------------- - // - // ---------------------------------------------------------------------- - w.endElement(); } private void writeGoalParameterTable( MojoDescriptor mojoDescriptor, XMLWriter w ) { - w.startElement( "p" ); - w.startElement( "table" ); w.startElement( "tr" ); @@ -183,24 +154,10 @@ public class PluginXdocGenerator w.endElement(); - w.startElement( "th" ); - - w.writeText( "Required?" ); - - w.endElement(); - - w.startElement( "th" ); - - w.writeText( "Deprecated?" ); - - w.endElement(); - w.endElement(); List parameters = mojoDescriptor.getParameters(); - Map parameterMap = mojoDescriptor.getParameterMap(); - for ( int i = 0; i < parameters.size(); i++ ) { Parameter parameter = (Parameter) parameters.get( i ); @@ -220,27 +177,51 @@ public class PluginXdocGenerator paramName = parameter.getName(); } + w.startElement( "code" ); + w.writeText( paramName ); w.endElement(); + if ( !parameter.isRequired() ) + { + w.writeMarkup( " (Optional)"); + } + + w.endElement(); + // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- w.startElement( "td" ); + w.startElement( "code" ); + w.writeText( parameter.getType() ); w.endElement(); + w.endElement(); + // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- w.startElement( "td" ); - w.writeText( parameter.getExpression() ); + w.startElement( "code" ); + + if ( StringUtils.isNotEmpty( parameter.getExpression() ) ) + { + w.writeText( parameter.getExpression() ); + } + else + { + w.writeText( "-" ); + } + + w.endElement(); w.endElement(); @@ -250,38 +231,32 @@ public class PluginXdocGenerator w.startElement( "td" ); - w.writeText( parameter.getDescription() ); - - w.endElement(); - - // ---------------------------------------------------------------------- - // - // ---------------------------------------------------------------------- - - w.startElement( "td" ); - - w.writeText( Boolean.toString( parameter.isRequired() ) ); - - w.endElement(); - - // ---------------------------------------------------------------------- - // - // ---------------------------------------------------------------------- + if ( StringUtils.isNotEmpty( parameter.getDescription() ) ) + { + w.writeMarkup( parameter.getDescription() ); + } + else + { + w.writeText( "No description." ); + } String deprecationWarning = parameter.getDeprecated(); - if ( StringUtils.isNotEmpty( deprecationWarning ) ) + if ( deprecationWarning != null ) { - w.startElement( "td" ); - - w.writeText( deprecationWarning ); + w.writeMarkup( "
Deprecated: "); + w.writeMarkup( deprecationWarning ); + if ( deprecationWarning.length() == 0 ) + { + w.writeText( "No reason given." ); + } w.endElement(); } w.endElement(); - } - w.endElement(); + w.endElement(); + } w.endElement(); } diff --git a/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/jelly/JellyHarnessGenerator.java b/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/jelly/JellyHarnessGenerator.java index 16f570caba..38b3a7d9f4 100644 --- a/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/jelly/JellyHarnessGenerator.java +++ b/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/jelly/JellyHarnessGenerator.java @@ -48,7 +48,7 @@ public class JellyHarnessGenerator return pluginDescriptor.getImplementation() + "Bean"; } - public void execute( String destinationDirectory, PluginDescriptor pluginDescriptor ) + public void execute( File destinationDirectory, PluginDescriptor pluginDescriptor ) throws IOException { FileWriter writer = null; diff --git a/maven-plugin-tools/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/generator/AbstractGeneratorTestCase.java b/maven-plugin-tools/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/generator/AbstractGeneratorTestCase.java index 9ee3dfd48d..9921ac5eab 100644 --- a/maven-plugin-tools/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/generator/AbstractGeneratorTestCase.java +++ b/maven-plugin-tools/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/generator/AbstractGeneratorTestCase.java @@ -58,7 +58,6 @@ public abstract class AbstractGeneratorTestCase List params = new ArrayList(); Parameter param = new Parameter(); - param.setDefaultValue( "value" ); param.setExpression( "${project.build.directory}" ); param.setName( "dir" ); param.setRequired( true ); @@ -70,6 +69,7 @@ public abstract class AbstractGeneratorTestCase mojoDescriptor.setParameters( params ); PluginDescriptor pluginDescriptor = new PluginDescriptor(); + mojoDescriptor.setPluginDescriptor( pluginDescriptor ); pluginDescriptor.addMojo( mojoDescriptor ); @@ -86,7 +86,7 @@ public abstract class AbstractGeneratorTestCase File tempFile = File.createTempFile( "testGenerator-outDir", ".marker.txt" ).getAbsoluteFile(); File destinationDirectory = tempFile.getParentFile(); - generator.execute( destinationDirectory.getAbsolutePath(), pluginDescriptor ); + generator.execute( destinationDirectory, pluginDescriptor ); validate( destinationDirectory ); } diff --git a/maven-plugin-tools/maven-plugin-tools-pluggy/src/main/java/org/apache/maven/tools/plugin/pluggy/Main.java b/maven-plugin-tools/maven-plugin-tools-pluggy/src/main/java/org/apache/maven/tools/plugin/pluggy/Main.java index 976881cad9..f078c76b58 100644 --- a/maven-plugin-tools/maven-plugin-tools-pluggy/src/main/java/org/apache/maven/tools/plugin/pluggy/Main.java +++ b/maven-plugin-tools/maven-plugin-tools-pluggy/src/main/java/org/apache/maven/tools/plugin/pluggy/Main.java @@ -123,6 +123,6 @@ public class Main // Use the generator to process the discovered descriptors and produce // something with them. - generator.execute( outputDirectory, pluginDescriptor ); + generator.execute( new File( outputDirectory ), pluginDescriptor ); } } diff --git a/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java b/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java index 192eac4c01..0214b3edff 100644 --- a/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java +++ b/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java @@ -27,6 +27,7 @@ import org.apache.maven.tools.plugin.scanner.MojoScanner; import org.apache.maven.tools.plugin.util.PluginUtils; import java.io.IOException; +import java.io.File; /** * @author Jason van Zyl @@ -52,7 +53,7 @@ public abstract class AbstractGeneratorMojo */ protected String goalPrefix; - protected abstract String getOutputDirectory(); + protected abstract File getOutputDirectory(); protected abstract Generator createGenerator(); @@ -86,6 +87,8 @@ public abstract class AbstractGeneratorMojo mojoScanner.populatePluginDescriptor( project, pluginDescriptor ); + getOutputDirectory().mkdirs(); + createGenerator().execute( getOutputDirectory(), pluginDescriptor ); } catch ( IOException e ) diff --git a/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/BeanGeneratorMojo.java b/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/BeanGeneratorMojo.java index 6231f07816..c81894b9a1 100644 --- a/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/BeanGeneratorMojo.java +++ b/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/BeanGeneratorMojo.java @@ -19,6 +19,8 @@ package org.apache.maven.plugin.plugin; import org.apache.maven.tools.plugin.generator.BeanGenerator; import org.apache.maven.tools.plugin.generator.Generator; +import java.io.File; + /** * @author Jason van Zyl * @version $Id$ @@ -31,9 +33,9 @@ public class BeanGeneratorMojo * @parameter expression="${project.build.directory}/generated-sources" * @required */ - protected String outputDirectory; + protected File outputDirectory; - protected String getOutputDirectory() + protected File getOutputDirectory() { return outputDirectory; } diff --git a/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java b/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java index 21bbed742c..d873afdc47 100644 --- a/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java +++ b/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java @@ -19,6 +19,8 @@ package org.apache.maven.plugin.plugin; import org.apache.maven.tools.plugin.generator.Generator; import org.apache.maven.tools.plugin.generator.PluginDescriptorGenerator; +import java.io.File; + /** * Generate a plugin descriptor. *

@@ -36,9 +38,9 @@ public class DescriptorGeneratorMojo * @parameter expression="${project.build.outputDirectory}/META-INF/maven" * @required */ - protected String outputDirectory; + protected File outputDirectory; - protected String getOutputDirectory() + protected File getOutputDirectory() { return outputDirectory; } diff --git a/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/JellyGeneratorMojo.java b/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/JellyGeneratorMojo.java index aac0971293..a3c1d09348 100644 --- a/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/JellyGeneratorMojo.java +++ b/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/JellyGeneratorMojo.java @@ -19,6 +19,8 @@ package org.apache.maven.plugin.plugin; import org.apache.maven.tools.plugin.generator.Generator; import org.apache.maven.tools.plugin.generator.jelly.JellyHarnessGenerator; +import java.io.File; + /** * @author Jason van Zyl * @version $Id$ @@ -31,9 +33,9 @@ public class JellyGeneratorMojo * @parameter expression="${project.build.directory}/generated-sources" * @required */ - protected String outputDirectory; + protected File outputDirectory; - protected String getOutputDirectory() + protected File getOutputDirectory() { return outputDirectory; } diff --git a/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/XdocGeneratorMojo.java b/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/XdocGeneratorMojo.java new file mode 100644 index 0000000000..6cecda4244 --- /dev/null +++ b/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/XdocGeneratorMojo.java @@ -0,0 +1,47 @@ +package org.apache.maven.plugin.plugin; + +/* + * Copyright 2001-2005 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.apache.maven.tools.plugin.generator.Generator; +import org.apache.maven.tools.plugin.generator.PluginXdocGenerator; + +import java.io.File; + +/** + * @author Brett Porter + * @version $Id$ + * @goal xdoc + */ +public class XdocGeneratorMojo + extends AbstractGeneratorMojo +{ + /** + * @parameter expression="${project.build.directory}/generated-xdocs" + * @required + */ + protected File outputDirectory; + + protected File getOutputDirectory() + { + return outputDirectory; + } + + protected Generator createGenerator() + { + return new PluginXdocGenerator(); + } +} diff --git a/maven-script/maven-script-marmalade/src/main/java/org/apache/maven/script/marmalade/tags/MojoDefinitionTagLibrary.java b/maven-script/maven-script-marmalade/src/main/java/org/apache/maven/script/marmalade/tags/MojoDefinitionTagLibrary.java index e239720529..4d007ecd3b 100644 --- a/maven-script/maven-script-marmalade/src/main/java/org/apache/maven/script/marmalade/tags/MojoDefinitionTagLibrary.java +++ b/maven-script/maven-script-marmalade/src/main/java/org/apache/maven/script/marmalade/tags/MojoDefinitionTagLibrary.java @@ -43,7 +43,6 @@ public class MojoDefinitionTagLibrary registerTag( "expression", ParamExpressionTag.class ); registerTag( "type", ParamTypeTag.class ); registerTag( "default", ParamDefaultTag.class ); - registerTag( "validator", ParamValidatorTag.class ); registerTag( "required", ParamRequiredTag.class ); } diff --git a/maven-script/maven-script-marmalade/src/main/java/org/apache/maven/script/marmalade/tags/ParamValidatorTag.java b/maven-script/maven-script-marmalade/src/main/java/org/apache/maven/script/marmalade/tags/ParamValidatorTag.java deleted file mode 100644 index 4f3d127025..0000000000 --- a/maven-script/maven-script-marmalade/src/main/java/org/apache/maven/script/marmalade/tags/ParamValidatorTag.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.apache.maven.script.marmalade.tags; - -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import org.codehaus.marmalade.runtime.MarmaladeExecutionException; - -/** - * @author jdcasey - */ -public class ParamValidatorTag - extends AbstractStringValuedBodyTag -{ - - protected void setValue( String value ) throws MarmaladeExecutionException - { - ParameterTag parent = (ParameterTag) requireParent( ParameterTag.class ); - parent.setValidator( value ); - } - -} \ No newline at end of file diff --git a/maven-script/maven-script-marmalade/src/main/java/org/apache/maven/script/marmalade/tags/ParameterTag.java b/maven-script/maven-script-marmalade/src/main/java/org/apache/maven/script/marmalade/tags/ParameterTag.java index 0afe750528..7f705863d7 100644 --- a/maven-script/maven-script-marmalade/src/main/java/org/apache/maven/script/marmalade/tags/ParameterTag.java +++ b/maven-script/maven-script-marmalade/src/main/java/org/apache/maven/script/marmalade/tags/ParameterTag.java @@ -37,10 +37,6 @@ public class ParameterTag private String expression; - private String validator; - - private String defaultVal; - private String deprecated; private boolean required = true; @@ -61,12 +57,10 @@ public class ParameterTag Parameter param = new Parameter(); param.setName( name ); - param.setDefaultValue( defaultVal ); param.setDescription( description ); param.setExpression( expression ); param.setRequired( required ); param.setType( type ); - param.setValidator( validator ); param.setDeprecated( deprecated ); return param; @@ -92,14 +86,8 @@ public class ParameterTag this.expression = expression; } - public void setValidator( String validator ) - { - this.validator = validator; - } - public void setDefault( String defaultVal ) { - this.defaultVal = defaultVal; } public void setRequired( boolean required )