Package org.jacoco.maven
Class MergeMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.jacoco.maven.AbstractJacocoMojo
-
- org.jacoco.maven.MergeMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="merge", defaultPhase=GENERATE_RESOURCES, threadSafe=true) public class MergeMojo extends AbstractJacocoMojo
Mojo for merging a set of execution data files (*.exec) into a single file- Since:
- 0.6.4
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.File
destFile
Path to the output file for execution data.private java.util.List<org.apache.maven.shared.model.fileset.FileSet>
fileSets
This mojo accepts any number of execution data file sets.private static java.lang.String
MSG_SKIPPING
-
Constructor Summary
Constructors Constructor Description MergeMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
canMergeReports()
private void
executeMerge()
protected void
executeMojo()
Executes Mojo.private void
load(ExecFileLoader loader)
private void
save(ExecFileLoader loader)
-
Methods inherited from class org.jacoco.maven.AbstractJacocoMojo
execute, getProject, skipMojo
-
-
-
-
Field Detail
-
MSG_SKIPPING
private static final java.lang.String MSG_SKIPPING
- See Also:
- Constant Field Values
-
destFile
@Parameter(property="jacoco.destFile", defaultValue="${project.build.directory}/jacoco.exec") private java.io.File destFile
Path to the output file for execution data.
-
fileSets
@Parameter(required=true) private java.util.List<org.apache.maven.shared.model.fileset.FileSet> fileSets
This mojo accepts any number of execution data file sets.<fileSets> <fileSet> <directory>${project.build.directory}</directory> <includes> <include>*.exec</include> </includes> </fileSet> </fileSets>
-
-
Method Detail
-
executeMojo
protected void executeMojo() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
Description copied from class:AbstractJacocoMojo
Executes Mojo.- Specified by:
executeMojo
in classAbstractJacocoMojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
- if an unexpected problem occurs. Throwing this exception causes a "BUILD ERROR" message to be displayed.org.apache.maven.plugin.MojoFailureException
- if an expected problem (such as a compilation failure) occurs. Throwing this exception causes a "BUILD FAILURE" message to be displayed.
-
canMergeReports
private boolean canMergeReports()
-
executeMerge
private void executeMerge() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
load
private void load(ExecFileLoader loader) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
save
private void save(ExecFileLoader loader) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
-