org.kuali.maven.mojo.s3
Class BaseMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.kuali.maven.mojo.s3.BaseMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
S3Mojo

public abstract class BaseMojo
extends org.apache.maven.plugin.AbstractMojo

Mojo essentials. Contains the "skip" logic that is the de facto standard for maven plugins. Contains a number of maven related properties that are common to most mojos. Also sets up logging so that if libraries called by a mojo issue log statements to Jakarta Commons Logging or Log4j, those log messages are shown in maven's output


Field Summary
private  String encoding
          The encoding to use when reading/writing files.
private  boolean forceMojoExecution
          Setting this parameter to true will force the execution of this mojo, even if it would get skipped usually.
static String FS
          Convenience reference to System.getProperty("file.separator").
private  org.apache.maven.execution.MavenSession mavenSession
           
private  org.apache.maven.project.MavenProject project
          The Maven project this plugin runs in.
private  org.apache.maven.settings.Settings settings
           
private  boolean skip
          When true, skip the execution of this mojo.
static String SKIP_PACKAGING_TYPE
          Skip packaging if type is "pom".
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
BaseMojo()
           
 
Method Summary
 void execute()
           
protected abstract  void executeMojo()
          This method is called after logging has been configured and only if mojo execution should not be skipped.
 String getEncoding()
           
 org.apache.maven.execution.MavenSession getMavenSession()
           
 org.apache.maven.project.MavenProject getProject()
           
 org.apache.maven.settings.Settings getSettings()
           
 boolean isForceMojoExecution()
           
 boolean isSkip()
           
 void setEncoding(String encoding)
           
 void setForceMojoExecution(boolean forceMojoExecution)
           
 void setMavenSession(org.apache.maven.execution.MavenSession mavenSession)
           
 void setProject(org.apache.maven.project.MavenProject project)
           
 void setSettings(org.apache.maven.settings.Settings settings)
           
 void setSkip(boolean skip)
           
protected  boolean skipMojo()
           Determine if the mojo execution should get skipped.
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FS

public static final String FS
Convenience reference to System.getProperty("file.separator").


SKIP_PACKAGING_TYPE

public static final String SKIP_PACKAGING_TYPE
Skip packaging if type is "pom".

See Also:
Constant Field Values

skip

private boolean skip
When true, skip the execution of this mojo.


forceMojoExecution

private boolean forceMojoExecution
Setting this parameter to true will force the execution of this mojo, even if it would get skipped usually.


encoding

private String encoding
The encoding to use when reading/writing files. If not specified this defaults to the platform specific encoding of whatever machine the build is running on.


project

private org.apache.maven.project.MavenProject project
The Maven project this plugin runs in.


settings

private org.apache.maven.settings.Settings settings
Since:
1.0

mavenSession

private org.apache.maven.execution.MavenSession mavenSession
Constructor Detail

BaseMojo

public BaseMojo()
Method Detail

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

executeMojo

protected abstract void executeMojo()
                             throws org.apache.maven.plugin.MojoExecutionException,
                                    org.apache.maven.plugin.MojoFailureException
This method is called after logging has been configured and only if mojo execution should not be skipped.

Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

skipMojo

protected boolean skipMojo()

Determine if the mojo execution should get skipped.

This is the case if:

Returns:
true if the mojo execution should be skipped.

isSkip

public boolean isSkip()
Returns:
the skip

setSkip

public void setSkip(boolean skip)
Parameters:
skip - the skip to set

isForceMojoExecution

public boolean isForceMojoExecution()
Returns:
the forceMojoExecution

setForceMojoExecution

public void setForceMojoExecution(boolean forceMojoExecution)
Parameters:
forceMojoExecution - the forceMojoExecution to set

getEncoding

public String getEncoding()
Returns:
the encoding

setEncoding

public void setEncoding(String encoding)
Parameters:
encoding - the encoding to set

getProject

public org.apache.maven.project.MavenProject getProject()
Returns:
the project

setProject

public void setProject(org.apache.maven.project.MavenProject project)
Parameters:
project - the project to set

getSettings

public org.apache.maven.settings.Settings getSettings()
Returns:
the settings

setSettings

public void setSettings(org.apache.maven.settings.Settings settings)
Parameters:
settings - the settings to set

getMavenSession

public org.apache.maven.execution.MavenSession getMavenSession()
Returns:
the mavenSession

setMavenSession

public void setMavenSession(org.apache.maven.execution.MavenSession mavenSession)
Parameters:
mavenSession - the mavenSession to set


Copyright © 2007-2011 The Kuali Foundation. All Rights Reserved.