Thanks for the quick response.
My exec plugin is as follows. How do I pass the configured argLine property
for Jacoco?
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>Start QE Tests</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<skip>${skipQeTests}</skip>
<executable>docker-compose</executable>
<commandlineArgs>up qe-tcases</commandlineArgs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
On Wednesday, January 22, 2025 at 4:15:33 AM UTC-6 Evgeny Mandrikov wrote:
> On Tue, Jan 21, 2025 at 7:41 PM Sunil Joseph <[email protected]> wrote:
>
>> Let me clear about my question. Is it possible to collect the Jacoco code
>> coverage report from maven-exec-plugin as in maven-failsafe-plugin?
>>
>
> Yes. Make sure that JVM with tests is using JaCoCo Java Agent:
> goals prepare-agent (
> https://www.jacoco.org/jacoco/trunk/doc/prepare-agent-mojo.html)
> and prepare-agent-integration (
> https://www.jacoco.org/jacoco/trunk/doc/prepare-agent-integration-mojo.html
> )
> of jacoco-maven-plugin
> populate property argLine by configuration of JaCoCo Java Agent
> this property is automatically picked up by maven-surefire-plugin (
> https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#argLine
> )
> and maven-failsafe-plugin (
> https://maven.apache.org/surefire/maven-failsafe-plugin/integration-test-mojo.html#argLine
> )
> so that agent is used during execution of tests.
>
> AFAICS https://www.mojohaus.org/exec-maven-plugin/exec-mojo.html#arguments
> uses different property name, so most likely you just need to explicitly
> pass correct property to exec-maven-plugin.
>
> Regards,
> Evgeny
>
>
>
>> On Tuesday, January 21, 2025 at 11:24:22 AM UTC-6 Sunil Joseph wrote:
>>
>>> Hi All,
>>> I am trying to collect the code coverage report for our play-framework
>>> java application that is running on a docker and our QE tests that is
>>> running from a maven-exec-plugin on a ubuntu vm (where the play-framework
>>> docker is hosted).
>>>
>>> The play-framework java app docker is build with the following JAVA
>>> options
>>> JAVA_OPTS="${JAVA_OPTS}
>>> -javaagent:/opt/docker/bin/jacoco-agent.jar=output=tcpserver,address=*,port=9003,excludes=router*"
>>>
>>> The integration test coverage report is working fine and that is run
>>> from maven-failsafe-plugin.
>>>
>>> Thank you All.
>>>
>> --
>> 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 visit
>> https://groups.google.com/d/msgid/jacoco/222ba60c-84e7-4ecb-bbff-c17ec7e2000fn%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/jacoco/222ba60c-84e7-4ecb-bbff-c17ec7e2000fn%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 [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/jacoco/51306c3d-e8d0-4a10-94a1-94e1fbd4334dn%40googlegroups.com.