maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mirko Friedenhagen <mfriedenha...@gmail.com>
Subject Multiple invocation of report goal with different configurations?
Date Sun, 19 May 2013 18:37:57 GMT
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