Package org.sonatype.plugins.munge
Class MungeMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.sonatype.plugins.munge.MungeMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="munge", defaultPhase=GENERATE_SOURCES) public class MungeMojo extends org.apache.maven.plugin.AbstractMojoMunges source files by keeping or removing sections of code according to what symbols are enabled.
-
-
Field Summary
Fields Modifier and Type Field Description private org.apache.maven.model.Buildbuildprivate java.lang.StringexcludesList of patterns (separated by commas) specifying files that should not be copied; by default exclude nothing.private org.apache.maven.project.MavenProjectexecutedProjectprivate java.lang.StringincludesList of patterns (separated by commas) specifying files that should be munged; by default munge everything.private java.lang.StringmungedDirectoryWhere to put the munged source files.private java.lang.StringsymbolsList of symbols (separated by commas) identifying which sections of munged code to keep.
-
Constructor Summary
Constructors Constructor Description MungeMojo()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute()static voidmunge(java.lang.String from, java.lang.String to, java.lang.String includes, java.lang.String excludes)Munges source files found infromand places them into, honoring any includes or excludes.
-
-
-
Field Detail
-
mungedDirectory
@Parameter(defaultValue="${project.build.directory}/munged") private java.lang.String mungedDirectoryWhere to put the munged source files.
-
symbols
@Parameter(defaultValue="${symbols}", required=true) private java.lang.String symbolsList of symbols (separated by commas) identifying which sections of munged code to keep.
-
includes
@Parameter(defaultValue="${includes}") private java.lang.String includesList of patterns (separated by commas) specifying files that should be munged; by default munge everything.
-
excludes
@Parameter(defaultValue="${excludes}") private java.lang.String excludesList of patterns (separated by commas) specifying files that should not be copied; by default exclude nothing.
-
build
@Parameter(property="project.build", readonly=true) private org.apache.maven.model.Build build
-
executedProject
@Parameter(property="executedProject", readonly=true) private org.apache.maven.project.MavenProject executedProject
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
munge
public static void munge(java.lang.String from, java.lang.String to, java.lang.String includes, java.lang.String excludes) throws org.apache.maven.plugin.MojoExecutionExceptionMunges source files found infromand places them into, honoring any includes or excludes.- Parameters:
from- The original source directoryto- The munged source directoryincludes- Comma-separated list of files to includeexcludes- Comma-separated list of files to exclude- Throws:
org.apache.maven.plugin.MojoExecutionException
-
-