Package org.wurbelizer.maven
Class AbstractWurbelMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.wurbelizer.maven.AbstractWurbelizerMojo
org.wurbelizer.maven.AbstractWurbelMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
TestWurbelMojo
,WurbelMojo
Base class for the wurbel mojos.
Scans the sources for @wurblet anchors and executes the wurblets. The generated code from the wurblets is merged into the sources.
Scans the sources for @wurblet anchors and executes the wurblets. The generated code from the wurblets is merged into the sources.
- Author:
- harald
-
Field Summary
Fields inherited from class org.wurbelizer.maven.AbstractWurbelizerMojo
charset, filesets, project, resourceDirs, session, skip, verbosity, verbosityLevel
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Properties
Creates the extra properties.createWurbler
(String filename, String wurbFilename, String[] wurbletPath, String analyzeDir, int phase, WurbletExecutionFilter wurbletFilter, boolean dryRun, Logger logger, Verbosity verbosity, Set<String> errorsSoFar, Set<Integer> collectedPhases) Creates aWurbler
.void
execute()
abstract File
Gets the directory for additional files generated by preceeding phases provided for wurblets.abstract File
Gets the directory holding the sources to be wurbelized.void
setClassRealm
(org.codehaus.plexus.classworlds.realm.ClassRealm classRealm) Sets the classrealm.protected void
validate()
Checks mandatory params.Methods inherited from class org.wurbelizer.maven.AbstractWurbelizerMojo
determineEncoding, determineVerbosity, exportExtraProperties, findResourceDirs, getPathRelativeToBasedir, getResourceDirName, isSkipped
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
AbstractWurbelMojo
public AbstractWurbelMojo()
-
-
Method Details
-
getSourceDir
Gets the directory holding the sources to be wurbelized.- Returns:
- the sources directory
-
getAnalyzeDir
Gets the directory for additional files generated by preceeding phases provided for wurblets.- Returns:
- the analyze-directory
-
setClassRealm
public void setClassRealm(org.codehaus.plexus.classworlds.realm.ClassRealm classRealm) Sets the classrealm.- Parameters:
classRealm
- the realm
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
-
createWurbler
public Wurbler createWurbler(String filename, String wurbFilename, String[] wurbletPath, String analyzeDir, int phase, WurbletExecutionFilter wurbletFilter, boolean dryRun, Logger logger, Verbosity verbosity, Set<String> errorsSoFar, Set<Integer> collectedPhases) throws WurbelException Creates aWurbler
.- Parameters:
filename
- the full pathname of the java-filewurbFilename
- optional wurblet properties file, null to check in same dirwurbletPath
- the list of package names to load wurblets from (if wurblet name is not absolute)analyzeDir
- the list of directories wurblets load extra information from (usually from apt-runs)phase
- the wurbel phase, 0 for heredocs, wurblets start at 1wurbletFilter
- optional wurblet execution filterdryRun
- true to just parse the source file, don't run any wurbletslogger
- the logger (can also be used by the wurblets)verbosity
- the verbosityerrorsSoFar
- a set of errors logged so far, null if no suppression of repeating errorscollectedPhases
- the phases of all wurblets detected so far- Returns:
- the wurbler
- Throws:
WurbelException
- if loading the wurb-file failed
-
createExtraProperties
Creates the extra properties.- Overrides:
createExtraProperties
in classAbstractWurbelizerMojo
- Returns:
- the properties
-
validate
protected void validate() throws org.apache.maven.plugin.MojoExecutionExceptionChecks mandatory params.- Throws:
org.apache.maven.plugin.MojoExecutionException
- if validation fails.
-