/******************************************************************************* * Copyright (c) 2009, 2015 Mountainminds GmbH & Co. KG and Contributors * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Mads Mohr Christensen - implementation of MergeMojo * *******************************************************************************/ package org.jacoco.maven; import java.io.File; import java.io.IOException; import java.util.List; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.shared.model.fileset.FileSet; import org.apache.maven.shared.model.fileset.util.FileSetManager; import org.jacoco.core.tools.ExecFileLoader; /** * Mojo for merging a set of execution data files (*.exec) into a single file * * @phase generate-resources * @goal merge * @requiresProject true * @threadSafe * @since 0.6.4 */ public class MergeMojo extends AbstractJacocoMojo { private static final String MSG_SKIPPING = "Skipping JaCoCo merge execution due to missing execution data files"; /** * Path to the output file for execution data. * * @parameter property="jacoco.destFile" * default-value="${project.build.directory}/jacoco.exec" */ private File destFile; /** * This mojo accepts any number of execution data file sets. * * Note that you need an implementation hint on fileset * with Maven 2 (not needed with Maven 3): * *
*
* <fileSets>
* <fileSet implementation="org.apache.maven.shared.model.fileset.FileSet">
* <directory>${project.parent.build.directory}</directory>
* <includes>
* <include>*.exec</include>
* </includes>
* </fileSet>
* </fileSets>
*
*
*
* @parameter property="jacoco.fileSets"
* @required
*/
private List