From 620b085450e635fe2772a04b0b180f2e2fea8530 Mon Sep 17 00:00:00 2001 From: rfscholte Date: Thu, 22 Apr 2021 21:49:59 +0200 Subject: [PATCH] Clean up code --- .../plugin/plugin/AbstractGeneratorMojo.java | 1 + .../plugin/plugin/DescriptorGeneratorMojo.java | 3 +++ .../maven/plugin/plugin/HelpGeneratorMojo.java | 3 +++ .../metadata/AddPluginArtifactMetadataMojo.java | 1 + .../MNG6109PluginDescriptorBuilder.java | 2 +- .../JavaAnnotationsMojoDescriptorExtractor.java | 12 ++++++------ .../annotations/datamodel/AnnotatedField.java | 1 + .../datamodel/ComponentAnnotationContent.java | 3 +++ .../datamodel/ExecuteAnnotationContent.java | 4 ++++ .../datamodel/MojoAnnotationContent.java | 15 +++++++++++++++ .../datamodel/ParameterAnnotationContent.java | 7 +++++++ .../scanner/DefaultMojoAnnotationsScanner.java | 3 ++- .../scanner/visitors/MojoAnnotationVisitor.java | 5 +++++ .../scanner/visitors/MojoClassVisitor.java | 13 +++++++++++-- .../scanner/visitors/MojoFieldVisitor.java | 3 +++ .../plugin/extractor/annotations/FooMojo.java | 3 ++- .../tools/plugin/DefaultPluginToolsRequest.java | 14 ++++++++++++++ .../tools/plugin/ExtendedMojoDescriptor.java | 4 ++++ .../AbstractScriptedMojoDescriptorExtractor.java | 1 + .../tools/plugin/scanner/DefaultMojoScanner.java | 2 ++ .../maven/tools/plugin/util/PluginUtils.java | 3 +++ .../plugin/scanner/DefaultMojoScannerTest.java | 1 - .../plugin/scanner/ScannerTestExtractor.java | 1 + .../maven/tools/plugin/scanner/TestExtractor.java | 1 + .../maven/tools/plugin/util/stubs/MojoStub.java | 10 ++++++++++ .../tools/plugin/generator/GeneratorUtils.java | 5 +++++ .../plugin/generator/PluginHelpGenerator.java | 1 + .../plugin/generator/PluginXdocGenerator.java | 1 + .../generator/AbstractGeneratorTestCase.java | 1 + .../generator/PluginDescriptorGeneratorTest.java | 5 +++-- .../plugin/generator/PluginHelpGeneratorTest.java | 1 + .../plugin/generator/PluginXdocGeneratorTest.java | 1 + .../plugin/generator/stubs/MavenReportStub.java | 7 +++++++ .../JavaJavadocMojoDescriptorExtractor.java | 7 +++---- .../extractor/javadoc/JavadocMojoAnnotation.java | 2 ++ .../extractor/ant/AntMojoDescriptorExtractor.java | 3 +++ .../BeanshellMojoDescriptorExtractor.java | 2 ++ 37 files changed, 134 insertions(+), 18 deletions(-) diff --git a/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java b/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java index 5de8cfcbc..f10bda4a3 100644 --- a/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java +++ b/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java @@ -182,6 +182,7 @@ public abstract class AbstractGeneratorMojo /** * {@inheritDoc} */ + @Override public void execute() throws MojoExecutionException { 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 8b141c471..89aa2476e 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 @@ -64,6 +64,7 @@ public class DescriptorGeneratorMojo /** * {@inheritDoc} */ + @Override protected File getOutputDirectory() { return outputDirectory; @@ -72,6 +73,7 @@ protected File getOutputDirectory() /** * {@inheritDoc} */ + @Override protected Generator createGenerator() { return new PluginDescriptorGenerator( getLog() ); @@ -80,6 +82,7 @@ protected Generator createGenerator() /** * {@inheritDoc} */ + @Override public void execute() throws MojoExecutionException { 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 767567bbd..7cc472e5a 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 @@ -67,6 +67,7 @@ public class HelpGeneratorMojo /** * {@inheritDoc} */ + @Override protected File getOutputDirectory() { return outputDirectory; @@ -75,6 +76,7 @@ protected File getOutputDirectory() /** * {@inheritDoc} */ + @Override protected Generator createGenerator() { return new PluginHelpGenerator().setHelpPackageName( helpPackageName ).setVelocityComponent( this.velocity ); @@ -83,6 +85,7 @@ protected Generator createGenerator() /** * {@inheritDoc} */ + @Override public void execute() throws MojoExecutionException { diff --git a/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/metadata/AddPluginArtifactMetadataMojo.java b/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/metadata/AddPluginArtifactMetadataMojo.java index 3afd87ef2..0711980ad 100644 --- a/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/metadata/AddPluginArtifactMetadataMojo.java +++ b/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/metadata/AddPluginArtifactMetadataMojo.java @@ -72,6 +72,7 @@ public class AddPluginArtifactMetadataMojo private boolean skip; /** {@inheritDoc} */ + @Override public void execute() throws MojoExecutionException { diff --git a/maven-plugin-plugin/src/main/java/org/apache/maven/plugins/plugin/descriptor/MNG6109PluginDescriptorBuilder.java b/maven-plugin-plugin/src/main/java/org/apache/maven/plugins/plugin/descriptor/MNG6109PluginDescriptorBuilder.java index 09743023c..e0a035d36 100644 --- a/maven-plugin-plugin/src/main/java/org/apache/maven/plugins/plugin/descriptor/MNG6109PluginDescriptorBuilder.java +++ b/maven-plugin-plugin/src/main/java/org/apache/maven/plugins/plugin/descriptor/MNG6109PluginDescriptorBuilder.java @@ -51,7 +51,7 @@ public MojoDescriptor buildComponentDescriptor( PlexusConfiguration c, PluginDes for ( PlexusConfiguration d : parameterConfigurations ) { String parameterName = d.getChild( "name" ).getValue(); - Parameter pd = (Parameter) mojoDescriptor.getParameterMap().get( parameterName ); + Parameter pd = mojoDescriptor.getParameterMap().get( parameterName ); String parameterSince = d.getChild( "since" ).getValue(); pd.setSince( parameterSince ); diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/JavaAnnotationsMojoDescriptorExtractor.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/JavaAnnotationsMojoDescriptorExtractor.java index 7b9afe7ab..aae592210 100644 --- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/JavaAnnotationsMojoDescriptorExtractor.java +++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/JavaAnnotationsMojoDescriptorExtractor.java @@ -31,6 +31,7 @@ import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; import java.util.TreeMap; import java.util.TreeSet; @@ -97,6 +98,7 @@ public class JavaAnnotationsMojoDescriptorExtractor @org.codehaus.plexus.component.annotations.Requirement private ArchiverManager archiverManager; + @Override public List execute( PluginToolsRequest request ) throws ExtractionException, InvalidPluginDescriptorException { @@ -137,7 +139,7 @@ private Map scanJavadoc( PluginToolsRequest request, for ( MojoAnnotatedClass mojoAnnotatedClass : mojoAnnotatedClasses ) { - if ( StringUtils.equals( mojoAnnotatedClass.getArtifact().getArtifactId(), + if ( Objects.equals( mojoAnnotatedClass.getArtifact().getArtifactId(), request.getProject().getArtifact().getArtifactId() ) ) { continue; @@ -413,12 +415,11 @@ protected Map discoverClasses( final PluginToolsRequest reque return discoverClasses( request.getEncoding(), request.getProject() ); } - @SuppressWarnings( "unchecked" ) protected Map discoverClasses( final String encoding, final MavenProject project ) { List sources = new ArrayList<>(); - for ( String source : (List) project.getCompileSourceRoots() ) + for ( String source : project.getCompileSourceRoots() ) { sources.add( new File( source ) ); } @@ -725,11 +726,10 @@ protected MavenProject getFromProjectReferences( Artifact artifact, MavenProject { return null; } - @SuppressWarnings( "unchecked" ) Collection mavenProjects = - project.getProjectReferences().values(); + Collection mavenProjects = project.getProjectReferences().values(); for ( MavenProject mavenProject : mavenProjects ) { - if ( StringUtils.equals( mavenProject.getId(), artifact.getId() ) ) + if ( Objects.equals( mavenProject.getId(), artifact.getId() ) ) { return mavenProject; } diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/datamodel/AnnotatedField.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/datamodel/AnnotatedField.java index 9ac1ed0d4..dca8eddc7 100644 --- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/datamodel/AnnotatedField.java +++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/datamodel/AnnotatedField.java @@ -54,6 +54,7 @@ public String toString() return sb.toString(); } + @Override public int compareTo( AnnotatedField annotatedField ) { return getFieldName().compareTo( annotatedField.getFieldName() ); diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/datamodel/ComponentAnnotationContent.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/datamodel/ComponentAnnotationContent.java index 4eabbb61b..219d25855 100644 --- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/datamodel/ComponentAnnotationContent.java +++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/datamodel/ComponentAnnotationContent.java @@ -47,6 +47,7 @@ public ComponentAnnotationContent( String fieldName, String role, String hint ) this.hint = hint; } + @Override public Class role() { // not used @@ -63,6 +64,7 @@ public String getRoleClassName() return roleClassName; } + @Override public String hint() { return hint == null ? "" : hint; @@ -73,6 +75,7 @@ public void hint( String hint ) this.hint = hint; } + @Override public Class annotationType() { return null; diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/datamodel/ExecuteAnnotationContent.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/datamodel/ExecuteAnnotationContent.java index f95ed3d2d..14b6b4ef7 100644 --- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/datamodel/ExecuteAnnotationContent.java +++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/datamodel/ExecuteAnnotationContent.java @@ -37,16 +37,19 @@ public class ExecuteAnnotationContent private LifecyclePhase phase; + @Override public LifecyclePhase phase() { return this.phase; } + @Override public String goal() { return this.goal; } + @Override public String lifecycle() { return this.lifecycle; @@ -69,6 +72,7 @@ public void lifecycle( String lifecycle ) } + @Override public Class annotationType() { return null; diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/datamodel/MojoAnnotationContent.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/datamodel/MojoAnnotationContent.java index 33104cb84..05bc092ee 100644 --- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/datamodel/MojoAnnotationContent.java +++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/datamodel/MojoAnnotationContent.java @@ -62,11 +62,13 @@ public class MojoAnnotationContent private boolean threadSafe = false; + @Override public Class annotationType() { return null; } + @Override public LifecyclePhase defaultPhase() { return defaultPhase; @@ -77,6 +79,7 @@ public void defaultPhase( String phase ) this.defaultPhase = LifecyclePhase.valueOf( phase ); } + @Override public ResolutionScope requiresDependencyResolution() { return requiresDependencyResolution; @@ -87,6 +90,7 @@ public void requiresDependencyResolution( String requiresDependencyResolution ) this.requiresDependencyResolution = ResolutionScope.valueOf( requiresDependencyResolution ); } + @Override public ResolutionScope requiresDependencyCollection() { return requiresDependencyCollection; @@ -97,6 +101,7 @@ public void requiresDependencyCollection( String requiresDependencyCollection ) this.requiresDependencyCollection = ResolutionScope.valueOf( requiresDependencyCollection ); } + @Override public InstantiationStrategy instantiationStrategy() { return instantiationStrategy; @@ -107,6 +112,7 @@ public void instantiationStrategy( String instantiationStrategy ) this.instantiationStrategy = InstantiationStrategy.valueOf( instantiationStrategy ); } + @Override public String executionStrategy() { return executionStrategy; @@ -117,6 +123,7 @@ public void executionStrategy( String executionStrategy ) this.executionStrategy = executionStrategy; } + @Override public boolean requiresProject() { return requiresProject; @@ -127,6 +134,7 @@ public void requiresProject( boolean requiresProject ) this.requiresProject = requiresProject; } + @Override public boolean requiresReports() { return requiresReports; @@ -137,6 +145,7 @@ public void requiresReports( boolean requiresReports ) this.requiresReports = requiresReports; } + @Override public boolean aggregator() { return aggregator; @@ -147,6 +156,7 @@ public void aggregator( boolean aggregator ) this.aggregator = aggregator; } + @Override public boolean requiresDirectInvocation() { return requiresDirectInvocation; @@ -157,6 +167,7 @@ public void requiresDirectInvocation( boolean requiresDirectInvocation ) this.requiresDirectInvocation = requiresDirectInvocation; } + @Override public boolean requiresOnline() { return requiresOnline; @@ -167,6 +178,7 @@ public void requiresOnline( boolean requiresOnline ) this.requiresOnline = requiresOnline; } + @Override public boolean inheritByDefault() { return inheritByDefault; @@ -177,6 +189,7 @@ public void inheritByDefault( boolean inheritByDefault ) this.inheritByDefault = inheritByDefault; } + @Override public String configurator() { return configurator; @@ -187,6 +200,7 @@ public void configurator( String configurator ) this.configurator = configurator; } + @Override public boolean threadSafe() { return threadSafe; @@ -197,6 +211,7 @@ public void threadSafe( boolean threadSafe ) this.threadSafe = threadSafe; } + @Override public String name() { return this.name; diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/datamodel/ParameterAnnotationContent.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/datamodel/ParameterAnnotationContent.java index 919aaa4bf..1db117ac4 100644 --- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/datamodel/ParameterAnnotationContent.java +++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/datamodel/ParameterAnnotationContent.java @@ -63,6 +63,7 @@ public ParameterAnnotationContent( String fieldName, String alias, String proper this.readonly = readonly; } + @Override public String name() { return name; @@ -73,6 +74,7 @@ public void name( String name ) this.name = name; } + @Override public String alias() { return alias; @@ -83,6 +85,7 @@ public void alias( String alias ) this.alias = alias; } + @Override public String property() { return property; @@ -93,6 +96,7 @@ public void property( String property ) this.property = property; } + @Override public String defaultValue() { return defaultValue; @@ -103,6 +107,7 @@ public void defaultValue( String defaultValue ) this.defaultValue = defaultValue; } + @Override public boolean required() { return required; @@ -113,6 +118,7 @@ public void required( boolean required ) this.required = required; } + @Override public boolean readonly() { return readonly; @@ -123,6 +129,7 @@ public void readonly( boolean readonly ) this.readonly = readonly; } + @Override public Class annotationType() { return null; diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/scanner/DefaultMojoAnnotationsScanner.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/scanner/DefaultMojoAnnotationsScanner.java index 2eab39174..d53848fd2 100644 --- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/scanner/DefaultMojoAnnotationsScanner.java +++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/scanner/DefaultMojoAnnotationsScanner.java @@ -66,6 +66,7 @@ public class DefaultMojoAnnotationsScanner private Reflector reflector = new Reflector(); + @Override public Map scan( MojoAnnotationsScannerRequest request ) throws ExtractionException { @@ -311,7 +312,7 @@ protected void analyzeVisitors( MojoClassVisitor mojoClassVisitor ) for ( Map.Entry entry : annotationVisitor.getAnnotationValues().entrySet() ) { String methodName = entry.getKey(); - if ( StringUtils.equals( "role", methodName ) ) + if ( "role".equals( methodName ) ) { Type type = (Type) entry.getValue(); componentAnnotationContent.setRoleClassName( type.getClassName() ); diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/scanner/visitors/MojoAnnotationVisitor.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/scanner/visitors/MojoAnnotationVisitor.java index 3977ed278..296cc01a2 100644 --- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/scanner/visitors/MojoAnnotationVisitor.java +++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/scanner/visitors/MojoAnnotationVisitor.java @@ -51,26 +51,31 @@ public Map getAnnotationValues() return annotationValues; } + @Override public void visit( String name, Object value ) { annotationValues.put( name, value ); } + @Override public void visitEnum( String name, String desc, String value ) { annotationValues.put( name, value ); } + @Override public AnnotationVisitor visitAnnotation( String name, String desc ) { return new MojoAnnotationVisitor( logger, this.annotationClassName ); } + @Override public AnnotationVisitor visitArray( String s ) { return new MojoAnnotationVisitor( logger, this.annotationClassName ); } + @Override public void visitEnd() { // no op diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/scanner/visitors/MojoClassVisitor.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/scanner/visitors/MojoClassVisitor.java index 2f3cf3004..6ebf4c668 100644 --- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/scanner/visitors/MojoClassVisitor.java +++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/scanner/visitors/MojoClassVisitor.java @@ -22,7 +22,6 @@ import org.apache.maven.tools.plugin.extractor.annotations.scanner.MojoAnnotatedClass; import org.apache.maven.tools.plugin.extractor.annotations.scanner.MojoAnnotationsScanner; import org.codehaus.plexus.logging.Logger; -import org.codehaus.plexus.util.StringUtils; import org.objectweb.asm.AnnotationVisitor; import org.objectweb.asm.Attribute; import org.objectweb.asm.ClassVisitor; @@ -35,6 +34,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; /** * @author Olivier Lamy @@ -101,7 +101,7 @@ public List findFieldWithAnnotation( Class annotation ) for ( MojoFieldVisitor mojoFieldVisitor : this.fieldVisitors ) { MojoAnnotationVisitor mojoAnnotationVisitor = mojoFieldVisitor.getMojoAnnotationVisitor(); - if ( mojoAnnotationVisitor != null && StringUtils.equals( annotationClassName, + if ( mojoAnnotationVisitor != null && Objects.equals( annotationClassName, mojoAnnotationVisitor.getAnnotationClassName() ) ) { mojoFieldVisitors.add( mojoFieldVisitor ); @@ -111,6 +111,7 @@ public List findFieldWithAnnotation( Class annotation ) return mojoFieldVisitors; } + @Override public void visit( int version, int access, String name, String signature, String superName, String[] interfaces ) { mojoAnnotatedClass = new MojoAnnotatedClass(); @@ -121,6 +122,7 @@ public void visit( int version, int access, String name, String signature, Strin } } + @Override public AnnotationVisitor visitAnnotation( String desc, boolean visible ) { String annotationClassName = Type.getType( desc ).getClassName(); @@ -133,6 +135,7 @@ public AnnotationVisitor visitAnnotation( String desc, boolean visible ) return mojoAnnotationVisitor; } + @Override public FieldVisitor visitField( int access, String name, String desc, String signature, Object value ) { MojoFieldVisitor mojoFieldVisitor = new MojoFieldVisitor( logger, name, Type.getType( desc ).getClassName() ); @@ -140,32 +143,38 @@ public FieldVisitor visitField( int access, String name, String desc, String sig return mojoFieldVisitor; } + @Override public MethodVisitor visitMethod( int access, String name, String desc, String signature, String[] exceptions ) { // we don't need methods informations return null; } + @Override public void visitAttribute( Attribute attr ) { // no op } + @Override public void visitSource( String source, String debug ) { // no op } + @Override public void visitOuterClass( String owner, String name, String desc ) { // no op } + @Override public void visitInnerClass( String name, String outerName, String innerName, int access ) { // no op } + @Override public void visitEnd() { // no op diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/scanner/visitors/MojoFieldVisitor.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/scanner/visitors/MojoFieldVisitor.java index 225478b4b..b3d03537f 100644 --- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/scanner/visitors/MojoFieldVisitor.java +++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/scanner/visitors/MojoFieldVisitor.java @@ -60,6 +60,7 @@ public String getFieldName() return fieldName; } + @Override public AnnotationVisitor visitAnnotation( String desc, boolean visible ) { String annotationClassName = Type.getType( desc ).getClassName(); @@ -71,11 +72,13 @@ public AnnotationVisitor visitAnnotation( String desc, boolean visible ) return mojoAnnotationVisitor; } + @Override public void visitAttribute( Attribute attribute ) { // no op } + @Override public void visitEnd() { // no op diff --git a/maven-plugin-tools-annotations/src/test/java/org/apache/maven/tools/plugin/extractor/annotations/FooMojo.java b/maven-plugin-tools-annotations/src/test/java/org/apache/maven/tools/plugin/extractor/annotations/FooMojo.java index 95b339d02..3543dd255 100644 --- a/maven-plugin-tools-annotations/src/test/java/org/apache/maven/tools/plugin/extractor/annotations/FooMojo.java +++ b/maven-plugin-tools-annotations/src/test/java/org/apache/maven/tools/plugin/extractor/annotations/FooMojo.java @@ -20,7 +20,6 @@ */ import org.apache.maven.artifact.metadata.ArtifactMetadataSource; -import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.Component; @@ -49,6 +48,7 @@ public class FooMojo * beer for non french folks * @deprecated wine is better */ + @Deprecated @Parameter( property = "thebeer", defaultValue = "coolbeer" ) protected String beer; @@ -64,6 +64,7 @@ public class FooMojo @Component( role = ArtifactMetadataSource.class, hint = "maven" ) protected ArtifactMetadataSource artifactMetadataSource; + @Override public void execute() throws MojoExecutionException, MojoFailureException { diff --git a/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/DefaultPluginToolsRequest.java b/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/DefaultPluginToolsRequest.java index 8f7014506..a05d28790 100644 --- a/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/DefaultPluginToolsRequest.java +++ b/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/DefaultPluginToolsRequest.java @@ -67,6 +67,7 @@ public DefaultPluginToolsRequest( MavenProject project, PluginDescriptor pluginD /** * {@inheritDoc} */ + @Override public PluginDescriptor getPluginDescriptor() { return pluginDescriptor; @@ -75,6 +76,7 @@ public PluginDescriptor getPluginDescriptor() /** * {@inheritDoc} */ + @Override public PluginToolsRequest setPluginDescriptor( PluginDescriptor pluginDescriptor ) { this.pluginDescriptor = pluginDescriptor; @@ -84,6 +86,7 @@ public PluginToolsRequest setPluginDescriptor( PluginDescriptor pluginDescriptor /** * {@inheritDoc} */ + @Override public MavenProject getProject() { return project; @@ -92,6 +95,7 @@ public MavenProject getProject() /** * {@inheritDoc} */ + @Override public PluginToolsRequest setProject( MavenProject project ) { this.project = project; @@ -101,6 +105,7 @@ public PluginToolsRequest setProject( MavenProject project ) /** * {@inheritDoc} */ + @Override public String getEncoding() { return this.encoding; @@ -109,6 +114,7 @@ public String getEncoding() /** * {@inheritDoc} */ + @Override public PluginToolsRequest setEncoding( String encoding ) { if ( StringUtils.isNotEmpty( encoding ) ) @@ -126,6 +132,7 @@ public PluginToolsRequest setEncoding( String encoding ) /** * {@inheritDoc} */ + @Override public boolean isSkipErrorNoDescriptorsFound() { return skipErrorNoDescriptorsFound; @@ -134,12 +141,14 @@ public boolean isSkipErrorNoDescriptorsFound() /** * {@inheritDoc} */ + @Override public PluginToolsRequest setSkipErrorNoDescriptorsFound( boolean skipErrorNoDescriptorsFound ) { this.skipErrorNoDescriptorsFound = skipErrorNoDescriptorsFound; return this; } + @Override public Set getDependencies() { if ( this.dependencies == null ) @@ -149,28 +158,33 @@ public Set getDependencies() return dependencies; } + @Override public PluginToolsRequest setDependencies( Set dependencies ) { this.dependencies = dependencies; return this; } + @Override public List getRemoteRepos() { return remoteRepos; } + @Override public PluginToolsRequest setRemoteRepos( List remoteRepos ) { this.remoteRepos = remoteRepos; return this; } + @Override public ArtifactRepository getLocal() { return local; } + @Override public PluginToolsRequest setLocal( ArtifactRepository local ) { this.local = local; diff --git a/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/ExtendedMojoDescriptor.java b/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/ExtendedMojoDescriptor.java index b905b0a8f..3f82db1e2 100644 --- a/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/ExtendedMojoDescriptor.java +++ b/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/ExtendedMojoDescriptor.java @@ -32,21 +32,25 @@ public class ExtendedMojoDescriptor private String requiresDependencyCollection = null; + @Override public boolean isThreadSafe() { return threadSafe; } + @Override public void setThreadSafe( boolean threadSafe ) { this.threadSafe = threadSafe; } + @Override public String getDependencyCollectionRequired() { return requiresDependencyCollection; } + @Override public void setDependencyCollectionRequired( String requiresDependencyCollection ) { this.requiresDependencyCollection = requiresDependencyCollection; diff --git a/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/extractor/AbstractScriptedMojoDescriptorExtractor.java b/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/extractor/AbstractScriptedMojoDescriptorExtractor.java index 8787a08b6..8955ffb15 100644 --- a/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/extractor/AbstractScriptedMojoDescriptorExtractor.java +++ b/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/extractor/AbstractScriptedMojoDescriptorExtractor.java @@ -44,6 +44,7 @@ public abstract class AbstractScriptedMojoDescriptorExtractor implements MojoDescriptorExtractor { /** {@inheritDoc} */ + @Override public List execute( PluginToolsRequest request ) throws ExtractionException, InvalidPluginDescriptorException { diff --git a/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/scanner/DefaultMojoScanner.java b/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/scanner/DefaultMojoScanner.java index 942a26b6a..67dc5dcd4 100644 --- a/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/scanner/DefaultMojoScanner.java +++ b/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/scanner/DefaultMojoScanner.java @@ -72,6 +72,7 @@ public DefaultMojoScanner() /** * {@inheritDoc} */ + @Override public void populatePluginDescriptor( PluginToolsRequest request ) throws ExtractionException, InvalidPluginDescriptorException { @@ -134,6 +135,7 @@ protected Set getActiveExtractors() return result; } + @Override public void setActiveExtractors( Set extractors ) { if ( extractors == null ) diff --git a/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/util/PluginUtils.java b/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/util/PluginUtils.java index 378b5f7f7..e0425dd93 100644 --- a/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/util/PluginUtils.java +++ b/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/util/PluginUtils.java @@ -52,6 +52,7 @@ private PluginUtils() * @deprecated wrong approach (fake components), documented parameter default values instead to learn people how to * discover them */ + @Deprecated public static final Map MAVEN_COMPONENTS; static { @@ -114,6 +115,7 @@ public static void sortMojos( List mojoDescriptors ) Collections.sort( mojoDescriptors, new Comparator() { /** {@inheritDoc} */ + @Override public int compare( MojoDescriptor mojo0, MojoDescriptor mojo1 ) { return mojo0.getGoal().compareToIgnoreCase( mojo1.getGoal() ); @@ -136,6 +138,7 @@ public static void sortMojoParameters( List parameters ) Collections.sort( parameters, new Comparator() { /** {@inheritDoc} */ + @Override public int compare( Parameter parameter1, Parameter parameter2 ) { return parameter1.getName().compareToIgnoreCase( parameter2.getName() ); diff --git a/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/scanner/DefaultMojoScannerTest.java b/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/scanner/DefaultMojoScannerTest.java index eeb1031fd..2c365e6cf 100644 --- a/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/scanner/DefaultMojoScannerTest.java +++ b/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/scanner/DefaultMojoScannerTest.java @@ -185,7 +185,6 @@ private PluginDescriptor createPluginDescriptor() protected void checkResult( PluginDescriptor pluginDescriptor, Collection expectedGoals ) { Set remainingGoals = new HashSet<>( expectedGoals ); - @SuppressWarnings( "unchecked" ) List descriptors = pluginDescriptor.getMojos(); if ( descriptors == null ) diff --git a/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/scanner/ScannerTestExtractor.java b/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/scanner/ScannerTestExtractor.java index 4a7a526e0..a46104f8b 100644 --- a/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/scanner/ScannerTestExtractor.java +++ b/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/scanner/ScannerTestExtractor.java @@ -50,6 +50,7 @@ public List execute( MavenProject project, PluginDescriptor plug return execute( new DefaultPluginToolsRequest( project, pluginDescriptor ) ); } + @Override public List execute( PluginToolsRequest request ) throws ExtractionException, InvalidPluginDescriptorException { diff --git a/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/scanner/TestExtractor.java b/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/scanner/TestExtractor.java index d228a49c0..46bff95e2 100644 --- a/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/scanner/TestExtractor.java +++ b/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/scanner/TestExtractor.java @@ -41,6 +41,7 @@ public List execute( MavenProject project, PluginDescriptor plug return execute( new DefaultPluginToolsRequest( project, pluginDescriptor ) ); } + @Override public List execute( PluginToolsRequest request ) { MojoDescriptor desc = new MojoDescriptor(); diff --git a/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/util/stubs/MojoStub.java b/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/util/stubs/MojoStub.java index 00abbaede..d652afa02 100644 --- a/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/util/stubs/MojoStub.java +++ b/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/util/stubs/MojoStub.java @@ -35,30 +35,35 @@ public class MojoStub extends AbstractMojo { /** {@inheritDoc} */ + @Override public Log getLog() { return super.getLog(); } /** {@inheritDoc} */ + @Override public Map getPluginContext() { return super.getPluginContext(); } /** {@inheritDoc} */ + @Override public void setLog( Log log ) { super.setLog( log ); } /** {@inheritDoc} */ + @Override public void setPluginContext( Map pluginContext ) { super.setPluginContext( pluginContext ); } /** {@inheritDoc} */ + @Override protected Object clone() throws CloneNotSupportedException { @@ -66,12 +71,14 @@ protected Object clone() } /** {@inheritDoc} */ + @Override public boolean equals( Object obj ) { return super.equals( obj ); } /** {@inheritDoc} */ + @Override protected void finalize() throws Throwable { @@ -79,18 +86,21 @@ protected void finalize() } /** {@inheritDoc} */ + @Override public int hashCode() { return super.hashCode(); } /** {@inheritDoc} */ + @Override public String toString() { return super.toString(); } /** {@inheritDoc} */ + @Override public void execute() throws MojoExecutionException, MojoFailureException { diff --git a/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/GeneratorUtils.java b/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/GeneratorUtils.java index f829d60a7..547e430a0 100644 --- a/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/GeneratorUtils.java +++ b/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/GeneratorUtils.java @@ -410,6 +410,7 @@ class Counter } /** {@inheritDoc} */ + @Override public void handleSimpleTag( HTML.Tag t, MutableAttributeSet a, int pos ) { simpleTag = true; @@ -420,6 +421,7 @@ public void handleSimpleTag( HTML.Tag t, MutableAttributeSet a, int pos ) } /** {@inheritDoc} */ + @Override public void handleStartTag( HTML.Tag t, MutableAttributeSet a, int pos ) { simpleTag = false; @@ -463,6 +465,7 @@ else if ( HTML.Tag.BODY.equals( t ) ) } /** {@inheritDoc} */ + @Override public void handleEndTag( HTML.Tag t, int pos ) { if ( HTML.Tag.OL.equals( t ) || HTML.Tag.UL.equals( t ) ) @@ -498,6 +501,7 @@ else if ( HTML.Tag.BODY.equals( t ) ) } /** {@inheritDoc} */ + @Override public void handleText( char[] data, int pos ) { /* @@ -521,6 +525,7 @@ public void handleText( char[] data, int pos ) } /** {@inheritDoc} */ + @Override public void flush() { flushPendingNewline(); diff --git a/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java b/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java index 06f4e29e4..2c3af5891 100644 --- a/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java +++ b/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java @@ -109,6 +109,7 @@ public PluginHelpGenerator() /** * {@inheritDoc} */ + @Override public void execute( File destinationDirectory, PluginToolsRequest request ) throws GeneratorException { diff --git a/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java b/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java index 8d3aefa54..1562b988a 100644 --- a/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java +++ b/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java @@ -101,6 +101,7 @@ public PluginXdocGenerator( MavenProject project, Locale locale ) /** * {@inheritDoc} */ + @Override public void execute( File destinationDirectory, PluginToolsRequest request ) throws GeneratorException { diff --git a/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/AbstractGeneratorTestCase.java b/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/AbstractGeneratorTestCase.java index e98b1283a..0f41386d4 100644 --- a/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/AbstractGeneratorTestCase.java +++ b/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/AbstractGeneratorTestCase.java @@ -48,6 +48,7 @@ public abstract class AbstractGeneratorTestCase protected String basedir; + @Override protected void setUp() throws Exception { diff --git a/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/PluginDescriptorGeneratorTest.java b/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/PluginDescriptorGeneratorTest.java index c5f5c9e9d..870466dc4 100644 --- a/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/PluginDescriptorGeneratorTest.java +++ b/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/PluginDescriptorGeneratorTest.java @@ -40,6 +40,7 @@ public class PluginDescriptorGeneratorTest extends AbstractGeneratorTestCase { + @Override protected void validate( File destinationDirectory ) throws Exception { @@ -53,7 +54,7 @@ protected void validate( File destinationDirectory ) assertEquals( 1, pluginDescriptor.getMojos().size() ); - MojoDescriptor mojoDescriptor = (MojoDescriptor) pluginDescriptor.getMojos().get( 0 ); + MojoDescriptor mojoDescriptor = pluginDescriptor.getMojos().get( 0 ); checkMojo( mojoDescriptor ); @@ -103,7 +104,7 @@ private void checkMojo( MojoDescriptor mojoDescriptor ) assertNotNull( mojoDescriptor.isDependencyResolutionRequired() ); // check the parameter. - checkParameter( (Parameter) mojoDescriptor.getParameters().get( 0 ) ); + checkParameter( mojoDescriptor.getParameters().get( 0 ) ); } private void checkParameter( Parameter parameter ) diff --git a/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/PluginHelpGeneratorTest.java b/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/PluginHelpGeneratorTest.java index bd5d3742a..ce4f91952 100644 --- a/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/PluginHelpGeneratorTest.java +++ b/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/PluginHelpGeneratorTest.java @@ -28,6 +28,7 @@ public class PluginHelpGeneratorTest extends AbstractGeneratorTestCase { // inherits tests from base class + @Override protected void setupGenerator() throws Exception { diff --git a/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/PluginXdocGeneratorTest.java b/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/PluginXdocGeneratorTest.java index 6429dc707..2d024e3b1 100644 --- a/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/PluginXdocGeneratorTest.java +++ b/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/PluginXdocGeneratorTest.java @@ -34,6 +34,7 @@ public class PluginXdocGeneratorTest // inherits tests from base class + @Override protected void validate( File destinationDirectory ) throws Exception { diff --git a/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/stubs/MavenReportStub.java b/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/stubs/MavenReportStub.java index 5f7ae4e50..936c230e9 100644 --- a/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/stubs/MavenReportStub.java +++ b/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/stubs/MavenReportStub.java @@ -35,6 +35,7 @@ public class MavenReportStub extends AbstractMavenReport { /** {@inheritDoc} */ + @Override protected void executeReport( Locale locale ) throws MavenReportException { @@ -42,36 +43,42 @@ protected void executeReport( Locale locale ) } /** {@inheritDoc} */ + @Override protected String getOutputDirectory() { return null; } /** {@inheritDoc} */ + @Override protected MavenProject getProject() { return null; } /** {@inheritDoc} */ + @Override protected Renderer getSiteRenderer() { return null; } /** {@inheritDoc} */ + @Override public String getDescription( Locale locale ) { return null; } /** {@inheritDoc} */ + @Override public String getName( Locale locale ) { return null; } /** {@inheritDoc} */ + @Override public String getOutputName() { return null; diff --git a/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/javadoc/JavaJavadocMojoDescriptorExtractor.java b/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/javadoc/JavaJavadocMojoDescriptorExtractor.java index 5b5e493e8..a44188847 100644 --- a/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/javadoc/JavaJavadocMojoDescriptorExtractor.java +++ b/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/javadoc/JavaJavadocMojoDescriptorExtractor.java @@ -566,7 +566,8 @@ private Map extractFieldParameterTags( JavaClass javaClass ) return rawParams; } - /** {@inheritDoc} */ + + @Override public List execute( PluginToolsRequest request ) throws ExtractionException, InvalidPluginDescriptorException { @@ -597,7 +598,6 @@ public List execute( PluginToolsRequest request ) * @param request The plugin request. * @return an array of java class */ - @SuppressWarnings( "unchecked" ) protected Collection discoverClasses( final PluginToolsRequest request ) { JavaProjectBuilder builder = new JavaProjectBuilder( new SortedClassLibraryBuilder() ); @@ -620,7 +620,7 @@ protected Collection discoverClasses( final PluginToolsRequest reques MavenProject project = request.getProject(); - for ( String source : (List) project.getCompileSourceRoots() ) + for ( String source : project.getCompileSourceRoots() ) { builder.addSourceTree( new File( source ) ); } @@ -642,7 +642,6 @@ protected Collection discoverClasses( final PluginToolsRequest reques protected void validate( MojoDescriptor mojoDescriptor ) throws InvalidParameterException { - @SuppressWarnings( "unchecked" ) List parameters = mojoDescriptor.getParameters(); if ( parameters != null ) diff --git a/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/javadoc/JavadocMojoAnnotation.java b/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/javadoc/JavadocMojoAnnotation.java index 3b9877c68..1c956fe77 100644 --- a/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/javadoc/JavadocMojoAnnotation.java +++ b/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/javadoc/JavadocMojoAnnotation.java @@ -219,6 +219,7 @@ public interface JavadocMojoAnnotation *

* @deprecated use @executionStrategy always instead */ + @Deprecated String MULTI_EXECUTION_STRATEGY = "attainAlways"; /** @@ -423,6 +424,7 @@ public interface JavadocMojoAnnotation *

* @deprecated use PARAMETER_PROPERTY instead */ + @Deprecated String PARAMETER_EXPRESSION = "expression"; /** diff --git a/maven-script/maven-plugin-tools-ant/src/main/java/org/apache/maven/tools/plugin/extractor/ant/AntMojoDescriptorExtractor.java b/maven-script/maven-plugin-tools-ant/src/main/java/org/apache/maven/tools/plugin/extractor/ant/AntMojoDescriptorExtractor.java index d0a1e681f..acd08a11b 100644 --- a/maven-script/maven-plugin-tools-ant/src/main/java/org/apache/maven/tools/plugin/extractor/ant/AntMojoDescriptorExtractor.java +++ b/maven-script/maven-plugin-tools-ant/src/main/java/org/apache/maven/tools/plugin/extractor/ant/AntMojoDescriptorExtractor.java @@ -57,6 +57,7 @@ public class AntMojoDescriptorExtractor private static final String SCRIPT_FILE_EXTENSION = ".build.xml"; /** {@inheritDoc} */ + @Override protected List extractMojoDescriptorsFromMetadata( Map> metadataFilesKeyedByBasedir, PluginToolsRequest request ) @@ -231,12 +232,14 @@ protected List extractMojoDescriptorsFromMetadata( } /** {@inheritDoc} */ + @Override protected String getScriptFileExtension( PluginToolsRequest request ) { return SCRIPT_FILE_EXTENSION; } /** {@inheritDoc} */ + @Override protected String getMetadataFileExtension( PluginToolsRequest request ) { return METADATA_FILE_EXTENSION; diff --git a/maven-script/maven-plugin-tools-beanshell/src/main/java/org/apache/maven/tools/plugin/extractor/beanshell/BeanshellMojoDescriptorExtractor.java b/maven-script/maven-plugin-tools-beanshell/src/main/java/org/apache/maven/tools/plugin/extractor/beanshell/BeanshellMojoDescriptorExtractor.java index 9a12df17c..14ba47d53 100644 --- a/maven-script/maven-plugin-tools-beanshell/src/main/java/org/apache/maven/tools/plugin/extractor/beanshell/BeanshellMojoDescriptorExtractor.java +++ b/maven-script/maven-plugin-tools-beanshell/src/main/java/org/apache/maven/tools/plugin/extractor/beanshell/BeanshellMojoDescriptorExtractor.java @@ -50,6 +50,7 @@ public class BeanshellMojoDescriptorExtractor /** * {@inheritDoc} */ + @Override protected String getScriptFileExtension( PluginToolsRequest request ) { return ".bsh"; @@ -58,6 +59,7 @@ protected String getScriptFileExtension( PluginToolsRequest request ) /** * {@inheritDoc} */ + @Override protected List extractMojoDescriptors( Map> scriptFilesKeyedByBasedir, PluginToolsRequest request ) throws ExtractionException, InvalidPluginDescriptorException