Class DefaultMojoAnnotationsScanner
- java.lang.Object
-
- org.codehaus.plexus.logging.AbstractLogEnabled
-
- org.apache.maven.tools.plugin.extractor.annotations.scanner.DefaultMojoAnnotationsScanner
-
- All Implemented Interfaces:
MojoAnnotationsScanner
,org.codehaus.plexus.logging.LogEnabled
@Named @Singleton public class DefaultMojoAnnotationsScanner extends org.codehaus.plexus.logging.AbstractLogEnabled implements MojoAnnotationsScanner
Mojo scanner with java annotations.- Since:
- 3.0
- Author:
- Olivier Lamy
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
COMPONENT_V3
static java.lang.String
COMPONENT_V4
static java.lang.String
EXECUTE_V3
static java.lang.String
EXECUTE_V4
static java.lang.String
MOJO_V3
static java.lang.String
MOJO_V4
static java.lang.String
MVN4_API
static java.lang.String
PARAMETER_V3
static java.lang.String
PARAMETER_V4
-
Fields inherited from interface org.apache.maven.tools.plugin.extractor.annotations.scanner.MojoAnnotationsScanner
CLASS_LEVEL_ANNOTATIONS, FIELD_LEVEL_ANNOTATIONS, METHOD_LEVEL_ANNOTATIONS, ROLE, V4_API_ANNOTATIONS_PACKAGE, V4_API_PLUGIN_PACKAGE
-
-
Constructor Summary
Constructors Constructor Description DefaultMojoAnnotationsScanner()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
analyzeVisitors(MojoClassVisitor mojoClassVisitor)
protected void
populateAnnotationContent(java.lang.Object content, MojoAnnotationVisitor mojoAnnotationVisitor)
protected void
scan(java.util.Map<java.lang.String,MojoAnnotatedClass> mojoAnnotatedClasses, java.io.File source, java.util.List<java.lang.String> includePatterns, org.apache.maven.artifact.Artifact artifact, boolean excludeMojo)
java.util.Map<java.lang.String,MojoAnnotatedClass>
scan(MojoAnnotationsScannerRequest request)
Scan classes for mojo annotations.protected java.util.Map<java.lang.String,MojoAnnotatedClass>
scanArchive(java.io.File archiveFile, org.apache.maven.artifact.Artifact artifact, boolean excludeMojo)
protected java.util.Map<java.lang.String,MojoAnnotatedClass>
scanDirectory(java.io.File classDirectory, java.util.List<java.lang.String> includePatterns, org.apache.maven.artifact.Artifact artifact, boolean excludeMojo)
-
-
-
Field Detail
-
MVN4_API
public static final java.lang.String MVN4_API
- See Also:
- Constant Field Values
-
MOJO_V4
public static final java.lang.String MOJO_V4
- See Also:
- Constant Field Values
-
EXECUTE_V4
public static final java.lang.String EXECUTE_V4
- See Also:
- Constant Field Values
-
PARAMETER_V4
public static final java.lang.String PARAMETER_V4
- See Also:
- Constant Field Values
-
COMPONENT_V4
public static final java.lang.String COMPONENT_V4
- See Also:
- Constant Field Values
-
MOJO_V3
public static final java.lang.String MOJO_V3
-
EXECUTE_V3
public static final java.lang.String EXECUTE_V3
-
PARAMETER_V3
public static final java.lang.String PARAMETER_V3
-
COMPONENT_V3
public static final java.lang.String COMPONENT_V3
-
-
Method Detail
-
scan
public java.util.Map<java.lang.String,MojoAnnotatedClass> scan(MojoAnnotationsScannerRequest request) throws org.apache.maven.tools.plugin.extractor.ExtractionException
Description copied from interface:MojoAnnotationsScanner
Scan classes for mojo annotations.- Specified by:
scan
in interfaceMojoAnnotationsScanner
- Returns:
- map of mojo-annotated classes keyed by full class name
- Throws:
org.apache.maven.tools.plugin.extractor.ExtractionException
-
scan
protected void scan(java.util.Map<java.lang.String,MojoAnnotatedClass> mojoAnnotatedClasses, java.io.File source, java.util.List<java.lang.String> includePatterns, org.apache.maven.artifact.Artifact artifact, boolean excludeMojo) throws java.io.IOException, org.apache.maven.tools.plugin.extractor.ExtractionException
- Throws:
java.io.IOException
org.apache.maven.tools.plugin.extractor.ExtractionException
-
scanArchive
protected java.util.Map<java.lang.String,MojoAnnotatedClass> scanArchive(java.io.File archiveFile, org.apache.maven.artifact.Artifact artifact, boolean excludeMojo) throws java.io.IOException, org.apache.maven.tools.plugin.extractor.ExtractionException
- Parameters:
archiveFile
-artifact
-excludeMojo
- for dependencies, we exclude Mojo annotations found- Returns:
- annotated classes found
- Throws:
java.io.IOException
org.apache.maven.tools.plugin.extractor.ExtractionException
-
scanDirectory
protected java.util.Map<java.lang.String,MojoAnnotatedClass> scanDirectory(java.io.File classDirectory, java.util.List<java.lang.String> includePatterns, org.apache.maven.artifact.Artifact artifact, boolean excludeMojo) throws java.io.IOException, org.apache.maven.tools.plugin.extractor.ExtractionException
- Parameters:
classDirectory
-includePatterns
-artifact
-excludeMojo
- for dependencies, we exclude Mojo annotations found- Returns:
- annotated classes found
- Throws:
java.io.IOException
org.apache.maven.tools.plugin.extractor.ExtractionException
-
populateAnnotationContent
protected void populateAnnotationContent(java.lang.Object content, MojoAnnotationVisitor mojoAnnotationVisitor) throws org.codehaus.plexus.util.reflection.ReflectorException
- Throws:
org.codehaus.plexus.util.reflection.ReflectorException
-
analyzeVisitors
protected void analyzeVisitors(MojoClassVisitor mojoClassVisitor) throws org.apache.maven.tools.plugin.extractor.ExtractionException
- Throws:
org.apache.maven.tools.plugin.extractor.ExtractionException
-
-