Class AbstractScriptedMojoDescriptorExtractor
java.lang.Object
org.codehaus.plexus.logging.AbstractLogEnabled
org.apache.maven.tools.plugin.extractor.AbstractScriptedMojoDescriptorExtractor
- All Implemented Interfaces:
MojoDescriptorExtractor
,org.codehaus.plexus.logging.LogEnabled
- Direct Known Subclasses:
AntMojoDescriptorExtractor
,BeanshellMojoDescriptorExtractor
public abstract class AbstractScriptedMojoDescriptorExtractor
extends org.codehaus.plexus.logging.AbstractLogEnabled
implements MojoDescriptorExtractor
- Author:
- jdcasey
-
Field Summary
Fields inherited from interface org.apache.maven.tools.plugin.extractor.MojoDescriptorExtractor
ROLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
copyScriptsToOutputDirectory(Map<String,Set<File>> scriptFilesKeyedByBasedir, String outputDirectory, PluginToolsRequest request)
List<org.apache.maven.plugin.descriptor.MojoDescriptor>
execute(PluginToolsRequest request)
Execute the mojo extraction.protected List<org.apache.maven.plugin.descriptor.MojoDescriptor>
extractMojoDescriptors(Map<String,Set<File>> scriptFilesKeyedByBasedir, PluginToolsRequest request)
Should be implemented in the sub classes.protected List<org.apache.maven.plugin.descriptor.MojoDescriptor>
extractMojoDescriptorsFromMetadata(Map<String,Set<File>> metadataFilesByBasedir, PluginToolsRequest request)
Should be implemented in the sub classes.gatherFilesByBasedir(File basedir, List<String> directories, String scriptFileExtension, PluginToolsRequest request)
protected String
getMetadataFileExtension(PluginToolsRequest request)
Should be implemented in the sub classes.protected abstract String
getScriptFileExtension(PluginToolsRequest request)
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Constructor Details
-
AbstractScriptedMojoDescriptorExtractor
-
-
Method Details
-
execute
public List<org.apache.maven.plugin.descriptor.MojoDescriptor> execute(PluginToolsRequest request) throws ExtractionException, org.apache.maven.plugin.descriptor.InvalidPluginDescriptorExceptionExecute the mojo extraction.- Specified by:
execute
in interfaceMojoDescriptorExtractor
- Parameters:
request
- ThePluginToolsRequest
containing information for the extraction process.- Returns:
- a list of mojo descriptors.
- Throws:
ExtractionException
- if anyorg.apache.maven.plugin.descriptor.InvalidPluginDescriptorException
- if any
-
copyScriptsToOutputDirectory
protected void copyScriptsToOutputDirectory(Map<String,Set<File>> scriptFilesKeyedByBasedir, String outputDirectory, PluginToolsRequest request) throws ExtractionException- Parameters:
scriptFilesKeyedByBasedir
- not nulloutputDirectory
- not nullrequest
- the request- Throws:
ExtractionException
- if any
-
gatherFilesByBasedir
protected Map<String,Set<File>> gatherFilesByBasedir(File basedir, List<String> directories, String scriptFileExtension, PluginToolsRequest request)- Parameters:
basedir
- not nulldirectories
- not nullscriptFileExtension
- not nullrequest
- the request- Returns:
- map with subdirs paths as key
-
extractMojoDescriptorsFromMetadata
protected List<org.apache.maven.plugin.descriptor.MojoDescriptor> extractMojoDescriptorsFromMetadata(Map<String,Set<File>> metadataFilesByBasedir, PluginToolsRequest request) throws ExtractionException, org.apache.maven.plugin.descriptor.InvalidPluginDescriptorExceptionShould be implemented in the sub classes.- Parameters:
metadataFilesByBasedir
- could be nullrequest
- The plugin request, nevernull
.- Returns:
- always null
- Throws:
ExtractionException
- if anyorg.apache.maven.plugin.descriptor.InvalidPluginDescriptorException
- if any
-
getMetadataFileExtension
Should be implemented in the sub classes.- Parameters:
request
- the request- Returns:
- always null
-
extractMojoDescriptors
protected List<org.apache.maven.plugin.descriptor.MojoDescriptor> extractMojoDescriptors(Map<String,Set<File>> scriptFilesKeyedByBasedir, PluginToolsRequest request) throws ExtractionException, org.apache.maven.plugin.descriptor.InvalidPluginDescriptorExceptionShould be implemented in the sub classes.- Parameters:
scriptFilesKeyedByBasedir
- could be nullrequest
- The plugin request, nevernull
.- Returns:
- always null
- Throws:
ExtractionException
- if anyorg.apache.maven.plugin.descriptor.InvalidPluginDescriptorException
- if any
-
getScriptFileExtension
- Parameters:
request
- the request- Returns:
- the file extension like
.bsh
for BeanShell.
-