<jacoco.skip>true</jacoco.skip>
This is what i have in my POM.
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5</version>
<executions>
<execution>
<id>pre-unit-test</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<destFile>${project.build.directory}/jacoco.exec</destFile>
<propertyName>surefireArgLine</propertyName>
</configuration>
</execution>
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration >
<dataFile>${project.build.directory}/jacoco.exec</dataFile>
<outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
On Monday, June 29, 2020 at 11:38:08 AM UTC+1, Evgeny Mandrikov wrote:
>
> Snippets of pom.xml are not complete minimal reproducible examples, so no
> idea what's wrong in your case - in the attachment you'll find complete
> minimal example that works just fine.
>
> Regards,
> Evgeny
>
>
>
> On Mon, Jun 29, 2020 at 12:23 PM <suresh...@gmail.com <javascript:>>
> wrote:
>
>> Thank you Evgeny,
>>
>> Removed that from configuration and added under properties, but still
>> this is not overriding.
>>
>> <properties>
>> <jacoco.skip>true</jacoco.skip>
>> </properties>
>>
>> and
>>
>> -Djacoco.skip=false to mvn install in jenkins.
>>
>>
>> Getting [INFO] Skipping JaCoCo execution because property jacoco.skip is set.
>>
>> [INFO] surefireArgLine set to empty.
>>
>>
>> Is there anything i missing, please help me with. I spend almost 2 days on
>> this now.
>>
>>
>>
>>
>> On Monday, June 29, 2020 at 10:23:25 AM UTC+1, Evgeny Mandrikov wrote:
>>>
>>> This has nothing to do with jacoco-maven-plugin - please refer to the
>>> documentation about Maven itself:
>>> You can not use properties to override configuration explicitly
>>> specified in your pom.xml file,
>>> i.e. everything here behaves as expected - "<skip>true</skip>" can not
>>> be overridden by "-Djacoco.skip=false" because this is how Maven works.
>>>
>>> To achieve what you want, instead of
>>>
>>> <configuration>
>>> <skip>true</skip>
>>> </configuration>
>>>
>>> you can specify
>>>
>>> <properties>
>>> <jacoco.skip>true</jacoco.skip>
>>> </properties>
>>>
>>>
>>> Regards,
>>> Evgeny
>>>
>>>
>>>
>>> On Mon, Jun 29, 2020 at 11:13 AM <suresh...@gmail.com> wrote:
>>>
>>>> Hi All,
>>>>
>>>> I have a requirement to Skip the Jacoco execution by default and have
>>>> to execute the same on demand by overriding -Djacoco.skip=false in Jenkins
>>>> build.
>>>>
>>>> I have this in my base-pom. which is working fine by default.
>>>>
>>>> <plugin>
>>>> <groupId>org.jacoco</groupId>
>>>> <artifactId>jacoco-maven-plugin</artifactId>
>>>> <version>0.8.3</version>
>>>> <executions>
>>>> <execution>
>>>> <id>pre-unit-test</id>
>>>> <goals>
>>>> <goal>prepare-agent</goal>
>>>> </goals>
>>>> <configuration combine.self="override">
>>>> <skip>true</skip>
>>>>
>>>> <destFile>${project.build.directory}/jacoco.exec</destFile>
>>>>
>>>> <propertyName>surefireArgLine</propertyName>
>>>> </configuration>
>>>> </execution>
>>>> <execution>
>>>> <id>post-unit-test</id>
>>>> <phase>test</phase>
>>>> <goals>
>>>> <goal>report</goal>
>>>> </goals>
>>>> <configuration combine.self="override">
>>>> <skip>true</skip>
>>>>
>>>> <dataFile>${project.build.directory}/jacoco.exec</dataFile>
>>>>
>>>> <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
>>>>
>>>> </configuration>
>>>> </execution>
>>>> </executions>
>>>> </plugin>
>>>>
>>>> overriding the same in mvn install -Djacoco.skip=false , but getting
>>>> this message.
>>>>
>>>>
>>>> [INFO] Skipping JaCoCo execution because property jacoco.skip is set.
>>>> [INFO] surefireArgLine set to empty
>>>>
>>>> --
>>>> 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 jac...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/jacoco/e2906d07-4167-4e7c-b13c-bbdcbd0b5402o%40googlegroups.com
>>>>
>>>> <https://groups.google.com/d/msgid/jacoco/e2906d07-4167-4e7c-b13c-bbdcbd0b5402o%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
>> 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 jac...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jacoco/fc17ddd7-caea-49a8-acc2-e4e003df9391o%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/jacoco/fc17ddd7-caea-49a8-acc2-e4e003df9391o%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
--
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 jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/jacoco/8430be53-a58e-49a5-8e92-0c872fa9609eo%40googlegroups.com.