Hi,

Initially in version 0.6.1 this was implemented as prepending of empty 
string ( see 
https://github.com/jacoco/jacoco/commit/ca863838a09a935572c3291da708870f6b9bc3c3#diff-1e1f9f25011241fca234b2856ec18b8eR175
 
associated with https://github.com/jacoco/jacoco/issues/44 ) to cover 
scenario when execution is skipped with following configuration

<properties>
  <-- no argLine here -->
</properties>

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <configuration>
    <argLine>-foobar ${argLine}</argLine>
  </configuration>
</plugin>

According to https://github.com/jacoco/jacoco/pull/192 there was regression 
in 0.6.4 regarding this.
But unfortunately behavior wasn't fully restored in 0.6.5 ( 
https://github.com/jacoco/jacoco/commit/c4aef33c74400419852d76b6579fbcbf58b4666e
 
) , i.e. it started to set empty instead of prepending empty string.

All in all - thank you for finding this bug! I created ticket 
https://github.com/jacoco/jacoco/issues/486

For now there are seems to be multiple ways to workaround this, like the 
one that you mention. Another one - is to use property dedicated for JaCoCo 
using "propertyName" parameter ( 
http://www.jacoco.org/jacoco/trunk/doc/prepare-agent-mojo.html#propertyName 
).

Hope this helps.

Regards,
Evgeny

On Saturday, January 28, 2017 at 4:54:09 PM UTC+1, Roberto Andrioli wrote:
>
> Hey Guys,
>
> I have another question about JaCoCo. 
>
> Why is JaCoCo plugin setting argLine to empty when the plugin execution is 
> skipped? Why simply does nothing? i.e., do not change argLine.
>
> I come with this question after setup a simple Maven project. In this 
> project I have a Java agent configured in the argLine directly in 
> properties section:
>
> ```
> <properties>
>     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>     <argLine>-javaagent:lib/my-custom-agent.jar 
> -Doutput.file=target/output.bin</argLine>
> </properties>
> ```
>
> JaCoCo plugin prepend its own configuration in the argLine and Surefire 
> runs everything perfectly. But when JaCoCo plugin is skipped, the argLine 
> is set to empty and my custom agent do not run.
>
> I know, I can easily fix this issue by configuring the Surefire plugin. 
> But there is some technical reason for this behavior?
>
> Thanks in advance
>
> Roberto
>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/af708c09-5c38-4139-a8e3-644e137b6a15%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to