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

public abstract class AbstractWurbelMojo extends AbstractWurbelizerMojo
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.
Author:
harald
  • Constructor Details

    • AbstractWurbelMojo

      public AbstractWurbelMojo()
  • Method Details

    • getSourceDir

      public abstract File getSourceDir()
      Gets the directory holding the sources to be wurbelized.
      Returns:
      the sources directory
    • getAnalyzeDir

      public abstract File 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 a Wurbler.
      Parameters:
      filename - the full pathname of the java-file
      wurbFilename - optional wurblet properties file, null to check in same dir
      wurbletPath - 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 1
      wurbletFilter - optional wurblet execution filter
      dryRun - true to just parse the source file, don't run any wurblets
      logger - the logger (can also be used by the wurblets)
      verbosity - the verbosity
      errorsSoFar - a set of errors logged so far, null if no suppression of repeating errors
      collectedPhases - the phases of all wurblets detected so far
      Returns:
      the wurbler
      Throws:
      WurbelException - if loading the wurb-file failed
    • createExtraProperties

      protected Properties createExtraProperties()
      Creates the extra properties.
      Overrides:
      createExtraProperties in class AbstractWurbelizerMojo
      Returns:
      the properties
    • validate

      protected void validate() throws org.apache.maven.plugin.MojoExecutionException
      Checks mandatory params.
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if validation fails.