public class IncrementalBuildHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CREATED_FILES_LST_FILENAME |
Constructor and Description |
---|
IncrementalBuildHelper(org.apache.maven.plugin.MojoExecution mojoExecution,
org.apache.maven.project.MavenProject mavenProject) |
IncrementalBuildHelper(org.apache.maven.plugin.MojoExecution mojoExecution,
org.apache.maven.execution.MavenSession mavenSession) |
Modifier and Type | Method and Description |
---|---|
void |
afterRebuildExecution()
This method collects and stores all information about files changed since
the call to
beforeRebuildExecution(java.io.File) . |
String[] |
beforeRebuildExecution(File outputDirectory)
This method shall get invoked before the actual mojo task gets triggered,
e.g.
|
org.apache.maven.shared.utils.io.DirectoryScanner |
getDirectoryScanner()
Get the existing DirectoryScanner used by this helper,
or create new a DirectoryScanner if none is yet set.
|
File |
getMojoStatusDirectory()
We use a specific status directory for each mojo execution to store state
which is needed during the next build invocation run.
|
boolean |
inputFileTreeChanged(org.apache.maven.shared.utils.io.DirectoryScanner dirScanner)
Detect whether the list of detected files picked up by the DirectoryScanner
has changed since the last build.
|
boolean |
inputFileTreeChanged(Set<File> inputFiles)
Detect whether the list of detected files has changed since the last build.
|
void |
setDirectoryScanner(org.apache.maven.shared.utils.io.DirectoryScanner directoryScanner)
Set the DirectoryScanner which shall get used by this build helper.
|
public static final String CREATED_FILES_LST_FILENAME
public IncrementalBuildHelper(org.apache.maven.plugin.MojoExecution mojoExecution, org.apache.maven.execution.MavenSession mavenSession)
public IncrementalBuildHelper(org.apache.maven.plugin.MojoExecution mojoExecution, org.apache.maven.project.MavenProject mavenProject)
public org.apache.maven.shared.utils.io.DirectoryScanner getDirectoryScanner()
public void setDirectoryScanner(org.apache.maven.shared.utils.io.DirectoryScanner directoryScanner)
directoryScanner
- public File getMojoStatusDirectory() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
public boolean inputFileTreeChanged(Set<File> inputFiles) throws org.apache.maven.plugin.MojoExecutionException
inputFiles
- true
if the set of inputFiles got changed since the last build.org.apache.maven.plugin.MojoExecutionException
public boolean inputFileTreeChanged(org.apache.maven.shared.utils.io.DirectoryScanner dirScanner) throws org.apache.maven.plugin.MojoExecutionException
dirScanner
- true
if the set of inputFiles got changed since the last build.org.apache.maven.plugin.MojoExecutionException
public String[] beforeRebuildExecution(File outputDirectory) throws org.apache.maven.plugin.MojoExecutionException
This method shall get invoked before the actual mojo task gets triggered, e.g. the actual compile in maven-compiler-plugin.
Attention: This method shall only get invoked if the plugin re-creates all the output.
It first picks up the list of files created in the previous build and delete them. This step is necessary to prevent left-overs. After that we take a 'directory snapshot' (list of all files which exist in the outputDirectory after the clean).
After the actual mojo task got executed you should invoke the method
afterRebuildExecution()
to collect the list of files which got changed
by this task.
outputDirectory
- org.apache.maven.plugin.MojoExecutionException
public void afterRebuildExecution() throws org.apache.maven.plugin.MojoExecutionException
This method collects and stores all information about files changed since
the call to beforeRebuildExecution(java.io.File)
.
Attention: This method shall only get invoked if the plugin re-creates all the output.
org.apache.maven.plugin.MojoExecutionException
Copyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.