updated parent pom and fixed errors reported by Checkstyle
git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@1642372 13f79535-47bb-0310-9956-ffa450edef68master
parent
311aa09218
commit
66444b15df
|
|
@ -53,7 +53,8 @@ public @interface Parameter
|
|||
String alias() default "";
|
||||
|
||||
/**
|
||||
* Property to use to retrieve a value. Can come from <code>-D</code> execution, setting properties or pom properties.
|
||||
* Property to use to retrieve a value. Can come from <code>-D</code> execution, setting properties or pom
|
||||
* properties.
|
||||
* @return property name
|
||||
*/
|
||||
String property() default "";
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@
|
|||
<groupId>org.apache.rat</groupId>
|
||||
<artifactId>apache-rat-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<excludes combine.children="append">
|
||||
<!-- This file should exactly match the output of this project -->
|
||||
<exclude>src/it/help-basic/expected-help.txt</exclude>
|
||||
</excludes>
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import org.apache.maven.tools.plugin.generator.Generator;
|
|||
import org.apache.maven.tools.plugin.generator.GeneratorException;
|
||||
import org.apache.maven.tools.plugin.generator.GeneratorUtils;
|
||||
import org.apache.maven.tools.plugin.scanner.MojoScanner;
|
||||
import org.codehaus.plexus.component.repository.ComponentDependency;
|
||||
import org.codehaus.plexus.util.ReaderFactory;
|
||||
|
||||
import java.io.File;
|
||||
|
|
@ -231,7 +232,8 @@ public abstract class AbstractGeneratorMojo
|
|||
|
||||
try
|
||||
{
|
||||
pluginDescriptor.setDependencies( GeneratorUtils.toComponentDependencies( project.getRuntimeDependencies() ) );
|
||||
List<ComponentDependency> deps = GeneratorUtils.toComponentDependencies( project.getRuntimeDependencies() );
|
||||
pluginDescriptor.setDependencies( deps );
|
||||
|
||||
PluginToolsRequest request = new DefaultPluginToolsRequest( project, pluginDescriptor );
|
||||
request.setEncoding( encoding );
|
||||
|
|
|
|||
|
|
@ -38,7 +38,8 @@ import org.codehaus.plexus.velocity.VelocityComponent;
|
|||
* @version $Id$
|
||||
* @since 2.4
|
||||
*/
|
||||
@Mojo( name = "helpmojo", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true, requiresDependencyResolution = ResolutionScope.COMPILE )
|
||||
@Mojo( name = "helpmojo", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true,
|
||||
requiresDependencyResolution = ResolutionScope.COMPILE )
|
||||
public class HelpGeneratorMojo
|
||||
extends AbstractGeneratorMojo
|
||||
{
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ import org.apache.maven.tools.plugin.generator.GeneratorUtils;
|
|||
import org.apache.maven.tools.plugin.generator.PluginXdocGenerator;
|
||||
import org.apache.maven.tools.plugin.scanner.MojoScanner;
|
||||
import org.apache.maven.tools.plugin.util.PluginUtils;
|
||||
import org.codehaus.plexus.component.repository.ComponentDependency;
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
import org.codehaus.plexus.util.xml.Xpp3Dom;
|
||||
|
||||
|
|
@ -258,7 +259,8 @@ public class PluginReport
|
|||
|
||||
try
|
||||
{
|
||||
pluginDescriptor.setDependencies( GeneratorUtils.toComponentDependencies( project.getRuntimeDependencies() ) );
|
||||
List<ComponentDependency> deps = GeneratorUtils.toComponentDependencies( project.getRuntimeDependencies() );
|
||||
pluginDescriptor.setDependencies( deps );
|
||||
|
||||
PluginToolsRequest request = new DefaultPluginToolsRequest( project, pluginDescriptor );
|
||||
request.setEncoding( encoding );
|
||||
|
|
@ -668,7 +670,8 @@ public class PluginReport
|
|||
String jdk = requirements.getJdk();
|
||||
if ( jdk == null )
|
||||
{
|
||||
jdk = discoverJdkRequirementFromPlugins( project.getBuild().getPluginsAsMap(), project.getProperties() );
|
||||
jdk = discoverJdkRequirementFromPlugins( project.getBuild().getPluginsAsMap(),
|
||||
project.getProperties() );
|
||||
}
|
||||
if ( jdk == null && project.getPluginManagement() != null )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -37,7 +37,8 @@ import org.apache.maven.project.MavenProject;
|
|||
* artifact, for subsequent installation and deployment.
|
||||
* It is used:
|
||||
* <ol>
|
||||
* <li>to add the <code>latest</code> metadata (which is plugin-specific) for shipping alongside the plugin's artifact</li>
|
||||
* <li>to add the <code>latest</code> metadata (which is plugin-specific) for shipping alongside the plugin's
|
||||
* artifact</li>
|
||||
* <li>to define plugin mapping in the group</li>
|
||||
* </ol>
|
||||
*
|
||||
|
|
|
|||
|
|
@ -283,8 +283,8 @@ public class JavaAnnotationsMojoDescriptorExtractor
|
|||
Map<String, ParameterAnnotationContent> parameters =
|
||||
getParametersParentHierarchy( entry.getValue(), new HashMap<String, ParameterAnnotationContent>(),
|
||||
mojoAnnotatedClasses );
|
||||
for ( Map.Entry<String, ParameterAnnotationContent> parameter : new TreeMap<String, ParameterAnnotationContent>(
|
||||
parameters ).entrySet() )
|
||||
parameters = new TreeMap<String, ParameterAnnotationContent>( parameters );
|
||||
for ( Map.Entry<String, ParameterAnnotationContent> parameter : parameters.entrySet() )
|
||||
{
|
||||
JavaField javaField = fieldsMap.get( parameter.getKey() );
|
||||
if ( javaField == null )
|
||||
|
|
@ -309,7 +309,8 @@ public class JavaAnnotationsMojoDescriptorExtractor
|
|||
}
|
||||
|
||||
// populate components
|
||||
for ( Map.Entry<String, ComponentAnnotationContent> component : entry.getValue().getComponents().entrySet() )
|
||||
Map<String, ComponentAnnotationContent> components = entry.getValue().getComponents();
|
||||
for ( Map.Entry<String, ComponentAnnotationContent> component : components.entrySet() )
|
||||
{
|
||||
JavaField javaField = fieldsMap.get( component.getKey() );
|
||||
if ( javaField == null )
|
||||
|
|
@ -580,9 +581,10 @@ public class JavaAnnotationsMojoDescriptorExtractor
|
|||
else
|
||||
{
|
||||
// not a component but a Maven object to be transformed into an expression/property: deprecated
|
||||
getLogger().warn( "Deprecated @Component annotation for '" + parameter.getName() + "' field in " +
|
||||
mojoAnnotatedClass.getClassName() +
|
||||
": replace with @Parameter( default-value = \"" + expression + "\", readonly = true )" );
|
||||
getLogger().warn( "Deprecated @Component annotation for '" + parameter.getName() + "' field in "
|
||||
+ mojoAnnotatedClass.getClassName()
|
||||
+ ": replace with @Parameter( default-value = \"" + expression
|
||||
+ "\", readonly = true )" );
|
||||
parameter.setDefaultValue( expression );
|
||||
parameter.setType( componentAnnotationContent.getRoleClassName() );
|
||||
parameter.setRequired( true );
|
||||
|
|
@ -605,7 +607,7 @@ public class JavaAnnotationsMojoDescriptorExtractor
|
|||
}
|
||||
|
||||
protected ExecuteAnnotationContent findExecuteInParentHierarchy( MojoAnnotatedClass mojoAnnotatedClass,
|
||||
Map<String, MojoAnnotatedClass> mojoAnnotatedClasses )
|
||||
Map<String, MojoAnnotatedClass> mojoAnnotatedClasses )
|
||||
{
|
||||
if ( mojoAnnotatedClass.getExecute() != null )
|
||||
{
|
||||
|
|
@ -648,8 +650,8 @@ public class JavaAnnotationsMojoDescriptorExtractor
|
|||
}
|
||||
|
||||
protected List<ParameterAnnotationContent> getParametersParent( MojoAnnotatedClass mojoAnnotatedClass,
|
||||
List<ParameterAnnotationContent> parameterAnnotationContents,
|
||||
Map<String, MojoAnnotatedClass> mojoAnnotatedClasses )
|
||||
List<ParameterAnnotationContent> parameterAnnotationContents,
|
||||
Map<String, MojoAnnotatedClass> mojoAnnotatedClasses )
|
||||
{
|
||||
parameterAnnotationContents.addAll( mojoAnnotatedClass.getParameters().values() );
|
||||
String parentClassName = mojoAnnotatedClass.getParentClassName();
|
||||
|
|
@ -687,8 +689,8 @@ public class JavaAnnotationsMojoDescriptorExtractor
|
|||
}
|
||||
|
||||
protected List<ComponentAnnotationContent> getComponentParent( MojoAnnotatedClass mojoAnnotatedClass,
|
||||
List<ComponentAnnotationContent> componentAnnotationContents,
|
||||
Map<String, MojoAnnotatedClass> mojoAnnotatedClasses )
|
||||
List<ComponentAnnotationContent> componentAnnotationContents,
|
||||
Map<String, MojoAnnotatedClass> mojoAnnotatedClasses )
|
||||
{
|
||||
componentAnnotationContents.addAll( mojoAnnotatedClass.getComponents().values() );
|
||||
String parentClassName = mojoAnnotatedClass.getParentClassName();
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ package org.apache.maven.tools.plugin.annotations.datamodel;
|
|||
*/
|
||||
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
|
||||
|
|
|
|||
|
|
@ -264,7 +264,8 @@ public class DefaultMojoAnnotationsScanner
|
|||
new ParameterAnnotationContent( mojoFieldVisitor.getFieldName(), mojoFieldVisitor.getClassName() );
|
||||
if ( mojoFieldVisitor.getMojoAnnotationVisitor() != null )
|
||||
{
|
||||
populateAnnotationContent( parameterAnnotationContent, mojoFieldVisitor.getMojoAnnotationVisitor() );
|
||||
populateAnnotationContent( parameterAnnotationContent,
|
||||
mojoFieldVisitor.getMojoAnnotationVisitor() );
|
||||
}
|
||||
|
||||
mojoAnnotatedClass.getParameters().put( parameterAnnotationContent.getFieldName(),
|
||||
|
|
@ -278,9 +279,10 @@ public class DefaultMojoAnnotationsScanner
|
|||
ComponentAnnotationContent componentAnnotationContent =
|
||||
new ComponentAnnotationContent( mojoFieldVisitor.getFieldName() );
|
||||
|
||||
if ( mojoFieldVisitor.getMojoAnnotationVisitor() != null )
|
||||
MojoAnnotationVisitor annotationVisitor = mojoFieldVisitor.getMojoAnnotationVisitor();
|
||||
if ( annotationVisitor != null )
|
||||
{
|
||||
for ( Map.Entry<String, Object> entry : mojoFieldVisitor.getMojoAnnotationVisitor().getAnnotationValues().entrySet() )
|
||||
for ( Map.Entry<String, Object> entry : annotationVisitor.getAnnotationValues().entrySet() )
|
||||
{
|
||||
String methodName = entry.getKey();
|
||||
if ( StringUtils.equals( "role", methodName ) )
|
||||
|
|
|
|||
|
|
@ -37,9 +37,9 @@ public interface MojoAnnotationsScanner
|
|||
{
|
||||
String ROLE = MojoAnnotationsScanner.class.getName();
|
||||
|
||||
final List<String> CLASS_LEVEL_ANNOTATIONS = Arrays.asList( Mojo.class.getName(), Execute.class.getName() );
|
||||
List<String> CLASS_LEVEL_ANNOTATIONS = Arrays.asList( Mojo.class.getName(), Execute.class.getName() );
|
||||
|
||||
final List<String> FIELD_LEVEL_ANNOTATIONS = Arrays.asList( Parameter.class.getName(), Component.class.getName() );
|
||||
List<String> FIELD_LEVEL_ANNOTATIONS = Arrays.asList( Parameter.class.getName(), Component.class.getName() );
|
||||
|
||||
/**
|
||||
* Scan classes for mojo annotations.
|
||||
|
|
|
|||
|
|
@ -58,8 +58,9 @@ public class AntMojoDescriptorExtractor
|
|||
private static final String SCRIPT_FILE_EXTENSION = ".build.xml";
|
||||
|
||||
/** {@inheritDoc} */
|
||||
protected List<MojoDescriptor> extractMojoDescriptorsFromMetadata( Map<String, Set<File>> metadataFilesKeyedByBasedir,
|
||||
PluginToolsRequest request )
|
||||
protected List<MojoDescriptor> extractMojoDescriptorsFromMetadata(
|
||||
Map<String, Set<File>> metadataFilesKeyedByBasedir,
|
||||
PluginToolsRequest request )
|
||||
throws ExtractionException, InvalidPluginDescriptorException
|
||||
{
|
||||
List<MojoDescriptor> descriptors = new ArrayList<MojoDescriptor>();
|
||||
|
|
@ -136,7 +137,8 @@ public class AntMojoDescriptorExtractor
|
|||
param.setName( "project" );
|
||||
param.setDefaultValue( "${project}" );
|
||||
param.setType( MavenProject.class.getName() );
|
||||
param.setDescription( "The current MavenProject instance, which contains classpath elements." );
|
||||
param.setDescription( "The current MavenProject instance, which contains classpath "
|
||||
+ "elements." );
|
||||
param.setEditable( false );
|
||||
param.setRequired( true );
|
||||
|
||||
|
|
@ -149,7 +151,8 @@ public class AntMojoDescriptorExtractor
|
|||
param.setName( "session" );
|
||||
param.setDefaultValue( "${session}" );
|
||||
param.setType( "org.apache.maven.execution.MavenSession" );
|
||||
param.setDescription( "The current MavenSession instance, which is used for plugin-style expression resolution." );
|
||||
param.setDescription( "The current MavenSession instance, which is used for "
|
||||
+ "plugin-style expression resolution." );
|
||||
param.setEditable( false );
|
||||
param.setRequired( true );
|
||||
|
||||
|
|
@ -162,7 +165,8 @@ public class AntMojoDescriptorExtractor
|
|||
param.setName( "mojoExecution" );
|
||||
param.setDefaultValue( "${mojoExecution}" );
|
||||
param.setType( "org.apache.maven.plugin.MojoExecution" );
|
||||
param.setDescription( "The current Maven MojoExecution instance, which contains information about the mojo currently executing." );
|
||||
param.setDescription( "The current Maven MojoExecution instance, which contains "
|
||||
+ "information about the mojo currently executing." );
|
||||
param.setEditable( false );
|
||||
param.setRequired( true );
|
||||
|
||||
|
|
@ -201,7 +205,8 @@ public class AntMojoDescriptorExtractor
|
|||
else
|
||||
{
|
||||
implementation =
|
||||
relativePath + dImpl.substring( PluginMetadataParser.IMPL_BASE_PLACEHOLDER.length() );
|
||||
relativePath
|
||||
+ dImpl.substring( PluginMetadataParser.IMPL_BASE_PLACEHOLDER.length() );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ package org.apache.maven.tools.plugin;
|
|||
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.codehaus.plexus.util.ReaderFactory;
|
||||
|
|
@ -33,7 +32,8 @@ import java.util.Set;
|
|||
|
||||
/**
|
||||
* Default implementation of {@link PluginToolsRequest}, which is used to pass parameters to components used to extract
|
||||
* {@link MojoDescriptor} instances from different types of metadata for a given plugin.
|
||||
* {@link org.apache.maven.plugin.descriptor.MojoDescriptor MojoDescriptor} instances from different types of metadata
|
||||
* for a given plugin.
|
||||
*
|
||||
* @author jdcasey
|
||||
* @since 2.5
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ package org.apache.maven.tools.plugin;
|
|||
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
|
||||
|
|
@ -29,7 +28,8 @@ import java.util.List;
|
|||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Request that encapsulates all information relevant to the process of extracting {@link MojoDescriptor}
|
||||
* Request that encapsulates all information relevant to the process of extracting
|
||||
* {@link org.apache.maven.plugin.descriptor.MojoDescriptor MojoDescriptor}
|
||||
* instances from metadata for a certain type of mojo.
|
||||
*
|
||||
* @author jdcasey
|
||||
|
|
|
|||
|
|
@ -83,7 +83,8 @@ public abstract class AbstractScriptedMojoDescriptorExtractor
|
|||
* @param outputDirectory not null
|
||||
* @throws ExtractionException if any
|
||||
*/
|
||||
protected void copyScriptsToOutputDirectory( Map<String, Set<File>> scriptFilesKeyedByBasedir, String outputDirectory, PluginToolsRequest request )
|
||||
protected void copyScriptsToOutputDirectory( Map<String, Set<File>> scriptFilesKeyedByBasedir,
|
||||
String outputDirectory, PluginToolsRequest request )
|
||||
throws ExtractionException
|
||||
{
|
||||
File outputDir = new File( outputDirectory );
|
||||
|
|
@ -134,7 +135,8 @@ public abstract class AbstractScriptedMojoDescriptorExtractor
|
|||
* @param scriptFileExtension not null
|
||||
* @return map with subdirs paths as key
|
||||
*/
|
||||
protected Map<String, Set<File>> gatherFilesByBasedir( File basedir, List<String> directories, String scriptFileExtension, PluginToolsRequest request )
|
||||
protected Map<String, Set<File>> gatherFilesByBasedir( File basedir, List<String> directories,
|
||||
String scriptFileExtension, PluginToolsRequest request )
|
||||
{
|
||||
Map<String, Set<File>> sourcesByBasedir = new TreeMap<String, Set<File>>();
|
||||
|
||||
|
|
@ -182,14 +184,14 @@ public abstract class AbstractScriptedMojoDescriptorExtractor
|
|||
/**
|
||||
* Should be implemented in the sub classes.
|
||||
*
|
||||
* @param metadataFilesKeyedByBasedir could be null
|
||||
* @param metadataFilesByBasedir could be null
|
||||
* @param request The plugin request, never <code>null</code>.
|
||||
* @return always null
|
||||
* @throws ExtractionException if any
|
||||
* @throws InvalidPluginDescriptorException if any
|
||||
*/
|
||||
protected List<MojoDescriptor> extractMojoDescriptorsFromMetadata( Map<String, Set<File>> metadataFilesKeyedByBasedir,
|
||||
PluginToolsRequest request )
|
||||
protected List<MojoDescriptor> extractMojoDescriptorsFromMetadata( Map<String, Set<File>> metadataFilesByBasedir,
|
||||
PluginToolsRequest request )
|
||||
throws ExtractionException, InvalidPluginDescriptorException
|
||||
{
|
||||
return null;
|
||||
|
|
@ -214,7 +216,8 @@ public abstract class AbstractScriptedMojoDescriptorExtractor
|
|||
* @throws ExtractionException if any
|
||||
* @throws InvalidPluginDescriptorException if any
|
||||
*/
|
||||
protected List<MojoDescriptor> extractMojoDescriptors( Map<String, Set<File>> scriptFilesKeyedByBasedir, PluginToolsRequest request )
|
||||
protected List<MojoDescriptor> extractMojoDescriptors( Map<String, Set<File>> scriptFilesKeyedByBasedir,
|
||||
PluginToolsRequest request )
|
||||
throws ExtractionException, InvalidPluginDescriptorException
|
||||
{
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -359,7 +359,7 @@ public final class GeneratorUtils
|
|||
*/
|
||||
class Counter
|
||||
{
|
||||
public int value;
|
||||
int value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -56,13 +56,13 @@ import java.util.Properties;
|
|||
|
||||
/**
|
||||
* Generates an <code>HelpMojo</code> class from <code>help-class-source.vm</code> template.
|
||||
* The generated mojo reads help content from <code>META-INF/maven/${groupId}/${artifactId}/plugin-help.xml</code> resource,
|
||||
* which is generated by this {@link PluginDescriptorGenerator}.
|
||||
* The generated mojo reads help content from <code>META-INF/maven/${groupId}/${artifactId}/plugin-help.xml</code>
|
||||
* resource, which is generated by this {@link PluginDescriptorGenerator}.
|
||||
* <p>Notice that the help mojo source needs to be generated before compilation, but when Java 5 annotations are used,
|
||||
* plugin descriptor content is available only after compilation (detecting annotations in .class files):
|
||||
* help mojo source can be generated with empty package only (and no plugin descriptor available yet), then needs
|
||||
* to be updated after compilation - through {@link #rewriteHelpMojo(PluginToolsRequest, Log)} which is called from plugin
|
||||
* descriptor XML generation.</p>
|
||||
* to be updated after compilation - through {@link #rewriteHelpMojo(PluginToolsRequest, Log)} which is called from
|
||||
* plugin descriptor XML generation.</p>
|
||||
*
|
||||
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
|
||||
* @version $Id$
|
||||
|
|
@ -138,7 +138,9 @@ public class PluginHelpGenerator
|
|||
|
||||
writeHelpPropertiesFile( request, destinationDirectory );
|
||||
|
||||
useAnnotations = request.getProject().getArtifactMap().containsKey( "org.apache.maven.plugin-tools:maven-plugin-annotations" );
|
||||
useAnnotations =
|
||||
request.getProject().getArtifactMap().containsKey(
|
||||
"org.apache.maven.plugin-tools:maven-plugin-annotations" );
|
||||
|
||||
try
|
||||
{
|
||||
|
|
@ -147,7 +149,8 @@ public class PluginHelpGenerator
|
|||
File helpClass = new File( destinationDirectory, sourcePath );
|
||||
helpClass.getParentFile().mkdirs();
|
||||
|
||||
String helpClassSources = getHelpClassSources( getPluginHelpPath( request.getProject() ), pluginDescriptor );
|
||||
String helpClassSources = getHelpClassSources( getPluginHelpPath( request.getProject() ),
|
||||
pluginDescriptor );
|
||||
|
||||
FileUtils.fileWrite( helpClass, request.getEncoding(), helpClassSources );
|
||||
}
|
||||
|
|
@ -201,7 +204,8 @@ public class PluginHelpGenerator
|
|||
InputStreamReader isReader = null;
|
||||
try
|
||||
{
|
||||
isReader = new InputStreamReader( is, "UTF-8" ); // plugin-tools sources are UTF-8 (and even ASCII in this case)
|
||||
isReader = new InputStreamReader( is, "UTF-8" ); // plugin-tools sources are UTF-8 (and even ASCII in this
|
||||
// case)
|
||||
velocityComponent.getEngine().evaluate( context, stringWriter, "", isReader );
|
||||
}
|
||||
catch ( UnsupportedEncodingException e )
|
||||
|
|
@ -229,7 +233,8 @@ public class PluginHelpGenerator
|
|||
helpPackageName = GeneratorUtils.discoverPackageName( pluginDescriptor );
|
||||
}
|
||||
|
||||
return StringUtils.isEmpty( helpPackageName ) ? HELP_MOJO_CLASS_NAME : helpPackageName + '.' + HELP_MOJO_CLASS_NAME;
|
||||
return StringUtils.isEmpty( helpPackageName ) ? HELP_MOJO_CLASS_NAME : helpPackageName + '.'
|
||||
+ HELP_MOJO_CLASS_NAME;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -330,7 +335,8 @@ public class PluginHelpGenerator
|
|||
}
|
||||
}
|
||||
|
||||
private static String rewriteHelpClassToMojoPackage( PluginToolsRequest request, File destinationDirectory, Log log )
|
||||
private static String rewriteHelpClassToMojoPackage( PluginToolsRequest request, File destinationDirectory,
|
||||
Log log )
|
||||
throws GeneratorException
|
||||
{
|
||||
String destinationPackage = GeneratorUtils.discoverPackageName( request.getPluginDescriptor() );
|
||||
|
|
@ -356,7 +362,8 @@ public class PluginHelpGenerator
|
|||
}
|
||||
else
|
||||
{
|
||||
File helpSourceFileNew = new File( destinationDirectory, packageAsDirectory + '/' + HELP_MOJO_CLASS_NAME + ".java" );
|
||||
File helpSourceFileNew =
|
||||
new File( destinationDirectory, packageAsDirectory + '/' + HELP_MOJO_CLASS_NAME + ".java" );
|
||||
if ( !helpSourceFileNew.getParentFile().exists() )
|
||||
{
|
||||
helpSourceFileNew.getParentFile().mkdirs();
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ package org.apache.maven.tools.plugin.extractor.java;
|
|||
* @version $Id$
|
||||
* @since 2.4
|
||||
*/
|
||||
@SuppressWarnings( "checkstyle:interfaceistype" )
|
||||
public interface JavaMojoAnnotation
|
||||
{
|
||||
// ----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -540,9 +540,10 @@ public class JavaMojoDescriptorExtractor
|
|||
else
|
||||
{
|
||||
// not a component but a Maven object to be transformed into an expression/property
|
||||
getLogger().warn(
|
||||
"Deprecated @component Javadoc tag for '" + pd.getName() + "' field in " + javaClass.getFullyQualifiedName() +
|
||||
": replace with @Parameter( defaultValue = \"" + role + "\", readonly = true )" );
|
||||
getLogger().warn( "Deprecated @component Javadoc tag for '" + pd.getName() + "' field in "
|
||||
+ javaClass.getFullyQualifiedName()
|
||||
+ ": replace with @Parameter( defaultValue = \"" + role
|
||||
+ "\", readonly = true )" );
|
||||
pd.setDefaultValue( role );
|
||||
pd.setRequired( true );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import org.apache.maven.tools.plugin.extractor.java.JavaMojoAnnotation;
|
|||
|
||||
import com.sun.tools.doclets.Taglet;
|
||||
|
||||
// CHECKSTYLE_OFF: LineLength
|
||||
/**
|
||||
* The <tt>@parameter</tt> tag is used to define a Mojo parameter and has annotation parameter.
|
||||
* <br/>
|
||||
|
|
@ -52,6 +53,7 @@ import com.sun.tools.doclets.Taglet;
|
|||
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
|
||||
* @version $Id$
|
||||
*/
|
||||
//CHECKSTYLE_ON: LineLength
|
||||
public class MojoParameterFieldTaglet
|
||||
extends AbstractMojoFieldTaglet
|
||||
{
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import org.apache.maven.tools.plugin.extractor.java.JavaMojoAnnotation;
|
|||
|
||||
import java.util.Map;
|
||||
|
||||
//CHECKSTYLE_OFF: LineLength
|
||||
/**
|
||||
* The <tt>@requiresDependencyCollection</tt> tag is used to specify the required dependencies in the specified scope
|
||||
* and has parameter.
|
||||
|
|
@ -52,6 +53,7 @@ import java.util.Map;
|
|||
* @author Kristian Rosenvold
|
||||
* @version $Id$
|
||||
*/
|
||||
//CHECKSTYLE_ON: LineLength
|
||||
public class MojoRequiresDependencyCollectionTypeTaglet
|
||||
extends AbstractMojoTypeTaglet
|
||||
{
|
||||
|
|
|
|||
|
|
@ -26,6 +26,9 @@ import org.codehaus.plexus.component.factory.ant.AntComponentFactory;
|
|||
import org.codehaus.plexus.component.factory.ant.AntScriptInvoker;
|
||||
import org.codehaus.plexus.component.repository.ComponentDescriptor;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class AntMojoComponentFactory
|
||||
extends AntComponentFactory
|
||||
{
|
||||
|
|
|
|||
|
|
@ -53,6 +53,9 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class AntMojoWrapper
|
||||
extends AbstractMojo
|
||||
implements ContextEnabled, MapOrientedComponent, LogEnabled
|
||||
|
|
@ -131,7 +134,8 @@ public class AntMojoWrapper
|
|||
buffer.append( "\n- " ).append( part );
|
||||
}
|
||||
|
||||
buffer.append( "\n\nMaven project, session, mojo-execution, or path-translation parameter information is " );
|
||||
buffer.append( "\n\nMaven project, session, mojo-execution, or path-translation parameter "
|
||||
+ "information is " );
|
||||
buffer.append( "\nmissing from this mojo's plugin descriptor." );
|
||||
buffer.append( "\n\nPerhaps this Ant-based mojo depends on maven-script-ant < 2.1.0, " );
|
||||
buffer.append( "or used maven-plugin-tools-ant < 2.2 during release?\n\n" );
|
||||
|
|
@ -218,8 +222,8 @@ public class AntMojoWrapper
|
|||
if ( mavenProject != null && session != null && pathTranslator != null )
|
||||
{
|
||||
ExpressionEvaluator exprEvaluator =
|
||||
new PluginParameterExpressionEvaluator( session, mojoExecution, pathTranslator, logger, mavenProject,
|
||||
mavenProject.getProperties() );
|
||||
new PluginParameterExpressionEvaluator( session, mojoExecution, pathTranslator, logger,
|
||||
mavenProject, mavenProject.getProperties() );
|
||||
|
||||
PropertyHelper propertyHelper = PropertyHelper.getPropertyHelper( antProject );
|
||||
propertyHelper.setNext( new AntPropertyHelper( exprEvaluator, mavenProject.getArtifacts(), getLog() ) );
|
||||
|
|
@ -238,7 +242,8 @@ public class AntMojoWrapper
|
|||
// Compile classpath
|
||||
Path p = new Path( antProject );
|
||||
|
||||
p.setPath( StringUtils.join( mavenProject.getCompileClasspathElements().iterator(), File.pathSeparator ) );
|
||||
p.setPath( StringUtils.join( mavenProject.getCompileClasspathElements().iterator(),
|
||||
File.pathSeparator ) );
|
||||
|
||||
/* maven.dependency.classpath it's deprecated as it's equal to maven.compile.classpath */
|
||||
references.put( "maven.dependency.classpath", p );
|
||||
|
|
@ -250,7 +255,8 @@ public class AntMojoWrapper
|
|||
// Runtime classpath
|
||||
p = new Path( antProject );
|
||||
|
||||
p.setPath( StringUtils.join( mavenProject.getRuntimeClasspathElements().iterator(), File.pathSeparator ) );
|
||||
p.setPath( StringUtils.join( mavenProject.getRuntimeClasspathElements().iterator(),
|
||||
File.pathSeparator ) );
|
||||
|
||||
references.put( "maven.runtime.classpath", p );
|
||||
antProject.addReference( "maven.runtime.classpath", p );
|
||||
|
|
@ -258,7 +264,8 @@ public class AntMojoWrapper
|
|||
// Test classpath
|
||||
p = new Path( antProject );
|
||||
|
||||
p.setPath( StringUtils.join( mavenProject.getTestClasspathElements().iterator(), File.pathSeparator ) );
|
||||
p.setPath( StringUtils.join( mavenProject.getTestClasspathElements().iterator(),
|
||||
File.pathSeparator ) );
|
||||
|
||||
references.put( "maven.test.classpath", p );
|
||||
antProject.addReference( "maven.test.classpath", p );
|
||||
|
|
@ -272,8 +279,9 @@ public class AntMojoWrapper
|
|||
if ( mojoExecution != null )
|
||||
{
|
||||
// Plugin dependency classpath
|
||||
|
||||
Path p = getPathFromArtifacts( mojoExecution.getMojoDescriptor().getPluginDescriptor().getArtifacts(), antProject );
|
||||
Path p =
|
||||
getPathFromArtifacts( mojoExecution.getMojoDescriptor().getPluginDescriptor().getArtifacts(),
|
||||
antProject );
|
||||
|
||||
references.put( "maven.plugin.classpath", p );
|
||||
antProject.addReference( "maven.plugin.classpath", p );
|
||||
|
|
@ -285,7 +293,7 @@ public class AntMojoWrapper
|
|||
}
|
||||
catch ( DependencyResolutionRequiredException e )
|
||||
{
|
||||
throw new MojoExecutionException( "Error creating classpath references for Ant-based plugin scripts.", e );
|
||||
throw new MojoExecutionException( "Error creating classpath references for Ant-based plugin scripts.", e );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,8 @@ public class AntPropertyHelper
|
|||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #AntPropertyHelper(ExpressionEvaluator, Set, Log)} to resolve maven.dependency.* properties
|
||||
* @deprecated use {@link #AntPropertyHelper(ExpressionEvaluator, Set, Log)} to resolve maven.dependency.*
|
||||
* properties
|
||||
* @param exprEvaluator
|
||||
* @param l
|
||||
*/
|
||||
|
|
|
|||
14
pom.xml
14
pom.xml
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>maven-parent</artifactId>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<version>24</version>
|
||||
<version>26</version>
|
||||
<relativePath>../pom/maven/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
@ -269,18 +269,6 @@
|
|||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin><!-- TODO remove when upgrading maven-parent to 25 -->
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<configuration>
|
||||
<topSiteURL>scm:svn:https://svn.apache.org/repos/infra/websites/production/maven/content/${maven.site.path}</topSiteURL>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin><!-- TODO remove when upgrading maven-parent to 25 -->
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-scm-publish-plugin</artifactId>
|
||||
<version>1.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-release-plugin</artifactId>
|
||||
|
|
|
|||
Loading…
Reference in New Issue