aboutsummaryrefslogtreecommitdiff
path: root/jacoco-maven-plugin
diff options
context:
space:
mode:
authorMarc R. Hoffmann <hoffmann@mountainminds.com>2013-05-20 12:56:11 +0200
committerMarc R. Hoffmann <hoffmann@mountainminds.com>2013-05-27 06:55:19 +0200
commitac07e252571819685d3f74cb69c90c23abd340a0 (patch)
tree1bf566cccd3830251dc96bd08c5d2f019a80aa32 /jacoco-maven-plugin
parent65d0700ffc0988767ca4c003b22063e56d2e837f (diff)
downloadjacoco-ac07e252571819685d3f74cb69c90c23abd340a0.tar.gz
Context information for error messages.
Analyzer and Instrumenter now expect a resource name parameter to provide better messages in case of internal errors.
Diffstat (limited to 'jacoco-maven-plugin')
-rw-r--r--jacoco-maven-plugin/src/org/jacoco/maven/InstrumentMojo.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/jacoco-maven-plugin/src/org/jacoco/maven/InstrumentMojo.java b/jacoco-maven-plugin/src/org/jacoco/maven/InstrumentMojo.java
index 0888b796..d5af656a 100644
--- a/jacoco-maven-plugin/src/org/jacoco/maven/InstrumentMojo.java
+++ b/jacoco-maven-plugin/src/org/jacoco/maven/InstrumentMojo.java
@@ -11,13 +11,6 @@
*******************************************************************************/
package org.jacoco.maven;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.util.IOUtil;
-import org.jacoco.core.instr.Instrumenter;
-import org.jacoco.core.runtime.OfflineInstrumentationAccessGenerator;
-
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@@ -26,6 +19,13 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.IOUtil;
+import org.jacoco.core.instr.Instrumenter;
+import org.jacoco.core.runtime.OfflineInstrumentationAccessGenerator;
+
/**
* Performs offline instrumentation. Note that after execution of test you must
* restore original classes with help of "restore-instrumented-classes" goal.
@@ -59,8 +59,8 @@ public class InstrumentMojo extends AbstractJacocoMojo {
final List<String> fileNames;
try {
- fileNames = new FileFilter(this.getIncludes(),
- this.getExcludes()).getFileNames(classesDir);
+ fileNames = new FileFilter(this.getIncludes(), this.getExcludes())
+ .getFileNames(classesDir);
} catch (final IOException e1) {
throw new MojoExecutionException(
"Unable to get list of files to instrument.", e1);
@@ -78,7 +78,7 @@ public class InstrumentMojo extends AbstractJacocoMojo {
FileUtils.copyFile(source, backup);
input = new FileInputStream(backup);
output = new FileOutputStream(source);
- instrumenter.instrument(input, output);
+ instrumenter.instrument(input, output, source.getPath());
} catch (final IOException e2) {
throw new MojoExecutionException(
"Unable to instrument file.", e2);