Maven site not link to Jacoco report

Marcos

I can generate Jacoco report from profile 'test' and is save inside site folder. But when I execute profile 'documentacion' which contains site generation description, I get all reports link in site, except link to Jacoco report, but this report still appears inside site folder.

This is part of my POM (I cut down part which is not important):

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <dependencies>
        <!-- Tests -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <!-- Dependencia para el informe de traducción -->
        <dependency>
            <groupId>com.googlecode.l10n-maven-plugin</groupId>
            <artifactId>l10n-maven-plugin</artifactId>
            <version>1.8</version>
        </dependency>
        ....
    </dependencies>
    <!-- Configuración común a todas las fases -->
    <build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.fxml</include>
                </includes>                
                <excludes>
                    <exclude>package-info.java</exclude>
                </excludes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>**/*.xml</include>
                    <include>**/*.css</include>
                    <include>**/*.png</include>
                    <include>**/*.fxml</include>
                    <include>**/*.ttf</include>
                    <include>*.properties</include>
                    <include>version.prop</include>
                </includes>
            </resource>
        </resources>
    </build>
    <!-- Perfiles -->
    <profiles>
        ......
        <profile>
            <id>documentacion</id>            
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <build>
                <defaultGoal>site:site</defaultGoal>
                <plugins>
                    <!-- Site -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-site-plugin</artifactId>
                        <version>3.4</version>
                    </plugin>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>0.7.2.201409121644</version>
                    </plugin>   
                </plugins>
            </build>            
            <reporting>
                <excludeDefaults>true</excludeDefaults>
                <outputDirectory>${project.build.directory}/site</outputDirectory>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-project-info-reports-plugin</artifactId>
                        <version>2.8</version>
                        <configuration>
                            <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
                        </configuration>
                        <reportSets>
                            <reportSet>
                                <reports>
                                    <report>summary</report>
                                    <report>index</report>
                                    <report>dependencies</report>
                                    <report>project-team</report>
                                    <report>license</report>
                                    <report>scm</report>
                                    <report>cim</report>
                                    <report>mailing-list</report>
                                    <report>issue-tracking</report>
                                </reports>  
                            </reportSet>
                        </reportSets>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-pmd-plugin</artifactId>
                        <version>3.3</version>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <version>2.13</version>
                        <configuration>
                            <configLocation>config/sun_checks.xml</configLocation>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jxr-plugin</artifactId>
                        <version>2.5</version>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>findbugs-maven-plugin</artifactId>
                        <version>3.0.0</version>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>l10n-maven-plugin</artifactId>
                        <version>1.0-alpha-2</version>
                        <configuration>
                            <locales>
                                <locale>es</locale>
                            </locales>
                        </configuration>
                    </plugin>        
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-changes-plugin</artifactId>
                        <version>2.11</version>
                        <reportSets>
                            <reportSet>
                                <reports>
                                    <report>changes-report</report>
                                </reports>
                            </reportSet>
                        </reportSets>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.10.1</version>
                        <configuration>
                            <useStandardDocletOptions>false</useStandardDocletOptions>
                            <additionalparam>-Xdoclint:none</additionalparam>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-report-plugin</artifactId>
                        <version>2.18.1</version>
                    </plugin>
                </plugins>
            </reporting>
        </profile>
        <profile>
            <id>test</id>            
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <build>
                <defaultGoal>validate test</defaultGoal>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>2.18.1</version>
                        <configuration>
                            <testFailureIgnore>true</testFailureIgnore>                            
                            <additionalClasspathElements>
                                <additionalClasspathElement>${java.home}/lib/jfxrt.jar</additionalClasspathElement>
                            </additionalClasspathElements>
                            <argLine>-Dfile.encoding=UTF-8</argLine>
                            <skipTests>${skip.unit.tests}</skipTests>
                        </configuration> 
                    </plugin>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>0.7.2.201409121644</version>
                        <executions>
                            <execution>
                                <id>pre-unit-test</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                                <configuration>
                                    <destFile>${project.build.directory}/coverage-reports/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}/coverage-reports/jacoco.exec</dataFile>
                                    <outputDirectory>${project.reporting.outputDirectory}/jacoco</outputDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>    
        </profile>
    </profiles>   
</project>

So, How can I get site link to Jacoco report?

Marcos

Finally, I can fix my POM so I get links to Jacoco and Surefire reports from maven site.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    ...
    <dependencies>
        <!-- Tests -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        ...
    </dependencies>
    <profiles>
        <profile>
            <id>desarrollo</id>
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <build>
                <defaultGoal>clean package</defaultGoal>
                <plugins>    
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jar-plugin</artifactId>
                        <version>2.5</version>
                        <configuration>
                            <archive>
                                <manifest>
                                    <addClasspath>true</addClasspath>
                                    <mainClass>com.***.App</mainClass>
                                </manifest>
                            </archive>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>documentacion</id>            
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <build>
                <defaultGoal>site:site</defaultGoal>
                <plugins>
                    <!-- Site -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-site-plugin</artifactId>
                        <version>3.4</version>
                    </plugin>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>0.7.2.201409121644</version>
                    </plugin>   
                </plugins>
            </build>            
            <reporting>
                <excludeDefaults>true</excludeDefaults>
                <outputDirectory>${project.build.directory}/site</outputDirectory>
                <plugins>
                    <!-- Plugin para generar el site con los reports -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-project-info-reports-plugin</artifactId>
                        <version>2.8</version>
                        <configuration>
                            <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
                        </configuration>
                        <reportSets>
                            <reportSet>
                                <reports>
                                    <report>summary</report>
                                    <report>index</report>
                                    <report>dependencies</report>
                                    <report>project-team</report>
                                    <report>license</report>
                                    <report>scm</report>
                                    <report>cim</report>
                                    <report>mailing-list</report>
                                    <report>issue-tracking</report>
                                </reports>  
                            </reportSet>
                        </reportSets>
                    </plugin> 
                    <!-- Reporte tests -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-report-plugin</artifactId>   
                        <version>2.18.1</version>   
                    </plugin>  
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>0.7.2.201409121644</version>
                    </plugin>   
                <!-- More report plugins place here (PMD, checkstyle...) -->                    
                </plugins>
            </reporting>
        </profile>
        <profile>
            <id>test</id>            
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <build>
                <defaultGoal>validate test</defaultGoal>
                <plugins>                    
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>2.18.1</version>
                        <configuration>
                            <outputDirectory>${project.build.directory}/site</outputDirectory>
                            <reportsDirectories>
                                <reportsDirectories>${project.build.directory}/site/surefire-reports</reportsDirectories>
                            </reportsDirectories>
                            <testFailureIgnore>true</testFailureIgnore>                            
                            <additionalClasspathElements>
                                <additionalClasspathElement>${java.home}/lib/jfxrt.jar</additionalClasspathElement>
                            </additionalClasspathElements>
                            <argLine>${argLine} -Dfile.encoding=UTF-8</argLine>
                        </configuration>        
                        <executions>
                            <execution>
                                <id>default-test</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>  
                    <!-- Test report -->
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>0.7.2.201409121644</version>
                        <executions>
                            <execution>
                                <id>default-prepare-agent</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>default-report</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>default-check</id>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>    
        </profile>
    </profiles>   
</project>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Jacoco Report are not generated in the site

From Dev

maven JaCoCo for site phase only

From Dev

maven jacoco: not generating code coverage report

From Dev

maven jacoco plugin does not generate coverage report

From Java

Maven Jacoco Configuration - Exclude classes/packages from report not working

From Dev

Maven/Jacoco - after succesful tests and jacoco datafiles merge, how to get a merged report?

From Dev

Jacoco Report Merging

From Dev

JaCoCo Report Format

From Dev

Maven site lifecycle failing while generating allure report

From Dev

Trouble configuring JaCoCo in maven

From Dev

Exclude folder in jacoco coverage report

From Dev

Open JaCoCo report in Intellij IDEA

From Dev

Empty Jacoco report for Android Espresso

From Dev

Jenkins jacoco plugin empty report

From Dev

Jacoco Coverage and Report Task with Ant

From Dev

JaCoCo Debug Coverage Test Report

From Dev

Empty Jacoco report for Android Espresso

From Dev

How to setup Jacoco with Wildfly and Maven

From Dev

Maven site fails on unpack-dependencies when trying to get javadoc report

From Dev

Maven PMD plug-in not generating a report with 'mvn site' command or 'pmd:pmd'

From Dev

Jacoco Test coverage report shows 0%

From Dev

JaCoCo coverage report setups(exclude test classes)

From Dev

Getting jacoco report from cucumber tests with gradle

From Dev

Jacoco Test coverage report shows 0%

From Dev

JaCoCo coverage report setups(exclude test classes)

From Dev

Can Jacoco CLI report be filtered via classfiles

From Dev

Replace Information Link in a Report

From Dev

Jacoco Maven plugin - include test sources

From Dev

Jacoco Maven multi module project coverage

Related Related

HotTag

Archive