Search code examples
mavencoberturaconfluencemaven-site-pluginmaven-cobertura-plugin

Maven - Deploy Cobertura Report to Confluence Wiki


I'm using the plugin called maven-confluence-reporting-plugin in order to deploy my documentation directly on a Confluence Wiki. This is working well and it has been correctly mapped/linked with the default site phase. Basically I followed these instruction.

Now I would like to integrate a Cobertura report, and also have it on Confluence, or at least I want to have a link to the Cobertura report available from Confluence.

Did anyone already do this ?

Basically, at the moment I can :

  • Either create a standard Maven site with the Cobertura report integrated.
  • Either deploy my site on Confluence, but without Cobertura report.

And I would like :

  • The Cobertura report to be available from Confluence.

I currently have this in my pom.xml :

            <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-site-plugin</artifactId>
            <version>3.0</version>
            <configuration>
                <reportPlugins>
                    <plugin>
                        <groupId>org.bsc.maven</groupId>
                        <artifactId>maven-confluence-reporting-plugin</artifactId>
                        <version>3.3.0-beta3</version>
                        <reportSets>
                            <reportSet>
                                <id>confluence</id>
                                <configuration>
                                    <endPoint>http://localhost:8090/rpc/xmlrpc</endPoint>
                                    <spaceKey>REP</spaceKey>
                                    <parentPageTitle>Home</parentPageTitle>
                                    <title>myFirstTest</title>
                                    <labels>
                                        <label>test</label>
                                        <label>confluence</label>
                                    </labels>
                                    <templateWiki>${basedir}/src/site/confluence/template.confluence</templateWiki>
                                    <wikiFilesExt>.confluence</wikiFilesExt>
                                    <serverId>confluence</serverId>
                                    <properties>
                                        <prop>the_text_value</prop><!-- SIMPLE TEXT -->
                                        <prop1>classpath:plugin-report.properties</prop1><!-- FROM CLASSPATH -->
                                        <prop2>file://${basedir}/confluence.html</prop2><!-- FROM FILE 
                                            SYSTEM -->
                                    </properties>
                                </configuration>
                                <reports>
                                    <report>confluence-summary</report>
                                </reports>
                            </reportSet>
                        </reportSets>
                    </plugin>

I don't see how I can add the Cobertura plugin in the above.


Solution

  • First I suggest you to follow the documentation here because from 4.x the plugin can be used without need to joint it to the site phase (I have to update codehaus docs)

    Second, keep in mind, that plugin deploy to confluence, pages already in wiki format so i think that the better way for you is

    1. Generate and deploy cobertura report
    2. Put inside your wiki page link to such site
    3. Deploy to confluence using goal confluence-reporting:deploy