maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mirko Friedenhagen <mfriedenha...@gmail.com>
Subject Re: Multiple invocation of report goal with different configurations?
Date Tue, 21 May 2013 21:05:35 GMT
Hello,

I now opened a pull request for jacoco[1] and somehow there seems to
be a change between maven-site-plugin-3.2 and maven-site-plugin-3.3,
the latter one allows to define multiple reportSets like in the
example below resp. on github[2]

[1] https://github.com/jacoco/jacoco/pull/105
[2] https://github.com/mfriedenhagen/jacoco/blob/5718ea545a9ad17ae057ebc224062d1e0cf7d0a1/jacoco-maven-plugin.test/it/it-site-failsafe/pom.xml#L103
Regards Mirko
--
http://illegalstateexception.blogspot.com/
https://github.com/mfriedenhagen/
https://bitbucket.org/mfriedenhagen/


On Sun, May 19, 2013 at 8:37 PM, Mirko Friedenhagen
<mfriedenhagen@gmail.com> wrote:
> Hello,
>
> configuring-reports[1] states:
> """
> If you want to choose only some reports from a plugin, or if you want
> to run a report *multiple times with a different configuration*, you
> need to configure report sets:
> """
> I now tried this with the jacoco-maven-plugin to differentiate between
> unit and integration tests like this:
>
>     <reporting>
>         <plugins>
>             <plugin>
>                 <groupId>org.jacoco</groupId>
>                 <artifactId>jacoco-maven-plugin</artifactId>
>                 <version> 0.6.2.201302030002</version>
>                 <reportSets>
>                     <reportSet>
>                         <id>unit-tests</id>
>                         <reports>
>                             <report>report</report>
>                         </reports>
>                         <configuration>
>
> <dataFile>${project.build.directory}/jacoco.exec</dataFile>
>                         </configuration>
>                     </reportSet>
>                     <reportSet>
>                         <id>integration-tests</id>
>                         <reports>
>                             <report>report</report>
>                         </reports>
>                         <configuration>
>
> <dataFile>${project.build.directory}/jacoco-it.exec</dataFile>
>                         </configuration>
>                     </reportSet>
>                 </reportSets>
>             </plugin>
>         </plugins>
>     </reporting>
>
> However, this does not work, as the configuration of the second
> reportSet will always override the first one. Looking into the
> plugin's code, this seems quite obvious:
> getOutputName[2] will always return "jacoco/index" and
> setReportOutputDirectory[3] will always just append "jacoco" to given
> parameter reportOutputDirectory.
> And in my sample project, the report goal will only be executed once.
>
> So my question: is there an example, where the same report mojo
> configured twice will be executed twice and return two different
> reports?
>
>
> Regards Mirko
> [1] http://maven.apache.org/plugins/maven-site-plugin/examples/configuring-reports.html
> [2] https://github.com/jacoco/jacoco/blob/master/jacoco-maven-plugin/src/org/jacoco/maven/ReportMojo.java#L131
> [3] https://github.com/jacoco/jacoco/blob/master/jacoco-maven-plugin/src/org/jacoco/maven/ReportMojo.java#L182

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message