org.codehaus.mojo.minijar
Class AbstractPluginMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.codehaus.mojo.minijar.AbstractPluginMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
MiniJarsMojo, UeberJarMojo

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

Common class for the minijar mojos


Field Summary
protected  File buildDirectory
           
protected  HashSet excludeDependencies
          If provided the default is to include all dependencies but remove the ones specified.
protected  HashSet excludeDependenciesInRelocation
          If provided the default is to relocate all dependencies but exclude the ones specified.
protected  HashSet includeDependencies
          If provided the default is to include no dependencies but the ones specified.
protected  HashSet includeDependenciesInRelocation
          If provided the default is to relocate no dependencies but the ones specified.
protected  HashSet keepUnusedClasses
          Explicitly mark classes matching the given patterns to be kept - no matter whether the analysis of minijar suggests otherwise.
protected  HashSet keepUnusedClassesFromArtifacts
          Explicitly mark all classes from the specified artifacts to be kept - no matter whether the analysis of minijar would suggest to remove (some of) them.
protected  boolean stripUnusedClasses
          By default minijar will analyse the class dependencies and remove classes that are not required for the execution of the project.
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractPluginMojo()
           
 
Method Summary
 void execute()
          Main entry point
abstract  void execute(Set removable, Set dependencies, Set relocateDependencies)
           
protected  org.apache.maven.project.MavenProject getProject()
           
 boolean isInKeepUnusedClasses(String clazzname)
           
 boolean isInKeepUnusedClassesFromArtifacts(org.apache.maven.artifact.Artifact artifact)
           
protected  String replaceVariables(Map pVariables, String pExpression)
          Substitute the variables in the given expression with the values from the Map.
 
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

buildDirectory

protected File buildDirectory

includeDependenciesInRelocation

protected HashSet includeDependenciesInRelocation
If provided the default is to relocate no dependencies but the ones specified. This parameter is mutual exclusive to excludeDependenciesInRelocation.


excludeDependenciesInRelocation

protected HashSet excludeDependenciesInRelocation
If provided the default is to relocate all dependencies but exclude the ones specified. This parameter is mutual exclusive to includeDependenciesInRelocation.


includeDependencies

protected HashSet includeDependencies
If provided the default is to include no dependencies but the ones specified. This parameter is mutual exclusive to excludeDependencies.


excludeDependencies

protected HashSet excludeDependencies
If provided the default is to include all dependencies but remove the ones specified. This parameter is mutual exclusive to includeDependencies.


stripUnusedClasses

protected boolean stripUnusedClasses
By default minijar will analyse the class dependencies and remove classes that are not required for the execution of the project. See the "keep.." parameters to explicitly override the behaviour for classes or resource that only loaded via reflection or set this parameter to false to turn off the magic.


keepUnusedClassesFromArtifacts

protected HashSet keepUnusedClassesFromArtifacts
Explicitly mark all classes from the specified artifacts to be kept - no matter whether the analysis of minijar would suggest to remove (some of) them.


keepUnusedClasses

protected HashSet keepUnusedClasses
Explicitly mark classes matching the given patterns to be kept - no matter whether the analysis of minijar suggests otherwise.

Constructor Detail

AbstractPluginMojo

public AbstractPluginMojo()
Method Detail

getProject

protected org.apache.maven.project.MavenProject getProject()

replaceVariables

protected String replaceVariables(Map pVariables,
                                  String pExpression)
Substitute the variables in the given expression with the values from the Map.

Parameters:
pVariables -
pExpression -
Returns:

isInKeepUnusedClassesFromArtifacts

public boolean isInKeepUnusedClassesFromArtifacts(org.apache.maven.artifact.Artifact artifact)

isInKeepUnusedClasses

public boolean isInKeepUnusedClasses(String clazzname)

execute

public abstract void execute(Set removable,
                             Set dependencies,
                             Set relocateDependencies)
                      throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException
Main entry point

Throws:
org.apache.maven.plugin.MojoExecutionException - on error


Copyright © 2011 Codehaus. All Rights Reserved.