1
resposta

Jacoco com erro EXECUTION DATA FILE

[INFO] --- maven-pmd-plugin:3.9.0:pmd (pmd) @ projectProducts ---
[WARNING] Unable to locate Source XRef to link to - DISABLED
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[WARNING] This analysis could be faster, please consider using Incremental Analysis: https://pmd.github.io/pmd-6.0.1/pmd_userdocs_getting_started.html#incremental-analysis
[INFO] 
[INFO] <<< maven-pmd-plugin:3.9.0:check (default) < :pmd @ projectProducts <<<
[INFO] 
[INFO] 
[INFO] --- maven-pmd-plugin:3.9.0:check (default) @ projectProducts ---
[INFO] 
[INFO] 
[INFO] --- jacoco-maven-plugin:0.8.0:prepare-agent (default) @ projectProducts ---
[INFO] argLine set to -javaagent:/Users/breno.ribeiro/.m2/repository/org/jacoco/org.jacoco.agent/0.8.0/org.jacoco.agent-0.8.0-runtime.jar=destfile=/Users/breno.ribeiro/Documents/workspace/myProjects/mavenStudy/projectProducts/target/jacoco.exec
[INFO] 
[INFO] --- jacoco-maven-plugin:0.8.0:report (default) @ projectProducts ---
[INFO] Skipping JaCoCo execution due to missing execution data file.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.841 s
[INFO] Finished at: 2018-02-26T09:55:35+01:00
[INFO] Final Memory: 27M/273M
[INFO] ------------------------------------------------------------------------
rakutenBamberg-brenoribeiro:projectProducts breno.ribeiro$

MY POM.XML

<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>de.com.studying.maven</groupId>
    <artifactId>projectProducts</artifactId>
    <packaging>jar</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>projectProducts</name>
    <url>http://maven.apache.org</url>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.thoughtworks.xstream</groupId>
            <artifactId>xstream</artifactId>
            <version>1.4.10</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>5.2.13.Final</version>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>3.9.0</version>
                <executions>
                    <execution>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.0</version>
                <executions>
                    <execution>
                        <phase>verify</phase>
                        <goals>
                            <goal>prepare-agent</goal>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
1 resposta

Olá Leandro tudo bem?

Pelo que olhei na documentação do JaCoCo essa versão espera que você configure (informe) os parâmetros para JVM rodar seus testes (tamanho da heap, metaspace entre outros)

Adicione a seguinte configuração dentro do seu pom:

<properties>
    <argLine>@{argLine}</argLine>
</properties>

Essa configuração deve ficar na abaixo da tag <project> (raiz do pom).

Espero ter ajudado

[]s