com.github.jknack.amd4j
Class Amd4jMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by com.github.jknack.amd4j.Amd4jMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
AnalizeMojo, OptimizeMojo

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


Field Summary
protected  String baseUrl
          The baseUrl to use.
protected  Boolean findNestedDependencies
          Turn on discovering of nested dependencies.
protected  String[] names
          The file to process.
protected  String[] paths
          Set paths for modules.
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
Amd4jMojo()
           
 
Method Summary
protected abstract  void doExecute(Amd4j amd4j, Config config)
          Execute the command.
 void execute()
           
protected  void execute(Amd4j amd4j, String basedir, String name)
          Execute the command.
protected  String header(String name)
          Generated a header for error reporting.
protected  Config merge(String name, Config config)
          Override any option that migh be specify from the command line.
protected  Config newConfig()
          Creates a new Config.
protected  void printf(String message, Object... args)
          Print a message to the maven output.
protected  void processError(String name, String message, Exception cause)
          Log the error and generate a build failure.
 
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

names

protected String[] names
The file to process.


baseUrl

protected String baseUrl
The baseUrl to use.


paths

protected String[] paths
Set paths for modules.


findNestedDependencies

protected Boolean findNestedDependencies
Turn on discovering of nested dependencies.

Constructor Detail

Amd4jMojo

public Amd4jMojo()
Method Detail

execute

public final void execute()
                   throws org.apache.maven.plugin.MojoExecutionException,
                          org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

execute

protected final void execute(Amd4j amd4j,
                             String basedir,
                             String name)
                      throws org.apache.maven.plugin.MojoExecutionException,
                             org.apache.maven.plugin.MojoFailureException
Execute the command.

Parameters:
amd4j - An Amd4j instance.
basedir - The working directory.
name - The script's name to execute.
Throws:
IOException - If something goes wrong.
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

processError

protected void processError(String name,
                            String message,
                            Exception cause)
                     throws org.apache.maven.plugin.MojoFailureException
Log the error and generate a build failure.

Parameters:
name - The script name.
message - The error message.
cause - The error cause.
Throws:
org.apache.maven.plugin.MojoFailureException - Generate a build failure.

header

protected String header(String name)
Generated a header for error reporting.

Parameters:
name - The script's name.
Returns:
A header.

doExecute

protected abstract void doExecute(Amd4j amd4j,
                                  Config config)
                           throws IOException
Execute the command.

Parameters:
amd4j - An Amd4j instance.
config - The configuration options.
Throws:
IOException - If something goes wrong.

newConfig

protected Config newConfig()
                    throws IOException
Creates a new Config.

Returns:
A new Config.
Throws:
IOException - If something goes wrong.

merge

protected Config merge(String name,
                       Config config)
                throws IOException
Override any option that migh be specify from the command line.

Parameters:
config - The configuration options.
Returns:
The same configuration options.
Throws:
IOException - If file handler can't be obtained.

printf

protected void printf(String message,
                      Object... args)
Print a message to the maven output.

Parameters:
message - The message.
args - The message's arguments.


Copyright © 2013. All Rights Reserved.