P Bielicki created MCOBERTURA-155:
-------------------------------------
Summary: Maven3 [instrument]: Unable to prepare instrumentation
directory.
Key: MCOBERTURA-155
URL: https://jira.codehaus.org/browse/MCOBERTURA-155
Project: Maven 2.x Cobertura Plugin
Issue Type: Bug
Affects Versions: 2.5.1
Environment: Maven3, JDK 1.7.0_01, Windows, Linux, Jenkins 1.442
Reporter: P Bielicki
Priority: Critical
Attachments: patch.txt
Hi,
in my pom.xml I have the following:
{code:xml}
<build>
<plugins>
...
<plugin>
... cobertura
<executions>
<execution>
<id>clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
<execution>
<id>package</id>
<phase>package</phase>
<goals>
<goal>instrument</goal>
<goal>check</goal>
</goals>
</execution>
</executions>
...
{code}
When I run {{mvn clean package}} I get this:
{code}[ERROR] Failed to execute goal
org.codehaus.mojo:cobertura-maven-plugin:2.5.1:instrument (package) on project
XXX: Unable to prepare instrumentation directory. source and destination are
the same directory. -> [Help 1]
...
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to prepare
instrumentation directory.
at
org.codehaus.mojo.cobertura.CoberturaInstrumentMojo.execute(CoberturaInstrumentMojo.java:134)
at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 23 more
Caused by: java.io.IOException: source and destination are the same directory.
at
org.codehaus.plexus.util.FileUtils.copyDirectoryStructure(FileUtils.java:2017)
at
org.codehaus.plexus.util.FileUtils.copyDirectoryStructure(FileUtils.java:1979)
at
org.codehaus.mojo.cobertura.CoberturaInstrumentMojo.execute(CoberturaInstrumentMojo.java:130)
... 25 more
{code}
The problem is in {{CoberturaInstrumentMojo.java}} line 121, namely after the
second run of the plugin {{outputDirectory}} is the same as
{{instrumentedDirectory}} because somehow
{{getProject().getBuild().getOutputDirectory()}} gets changed magically.
I have a dirty workaround that works for me (see attached patch)
Could you please fix it properly (if possible)? Or if you know what's wrong I
can do the fix - just explain me what's wrong (I'm not an expert in Maven
lifecycle, yet).
Cheers,
Przemyslaw Bielicki
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email