Подключил плагин JaCoCo, получил ошибку Skipping JaCoCo execution due to missing execution data file, как пофиксить?
Смотрел ответы, с вот такой штукой <argLine>-Xmx2048m</argLine>, не знаю как правильно пользоваться, но добавлял так:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M7</version>
<configuration>
<argLine>-Xmx2048m</argLine>
</configuration>
</plugin>
Также не работает это(возможно не правильно применил):
<configuration>
<destfile>${project.artifactId}/target/jacoco.exec</destfile>
</configuration>
Весь файл pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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>
<groupId>com.dmdev</groupId>
<artifactId>first-maven</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>first-maven</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>5.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.5.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.0.5.RELEASE</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>5.1.7.RELEASE</version>
</dependency>
</dependencies>
<build>
<finalName>ROOT</finalName>
<plugins>
<!-- Для тестов-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.0.0-M7</version>
<configuration>
<argLine>-Xmx4096m -XX:MaxPermSize=512M</argLine>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<!-- <phase>test</phase>-->
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>copy-docker-files</id>
<goals>
<goal>copy-resources</goal>
</goals>
<phase>validate</phase>
<configuration>
<outputDirectory>${project.basedir}/target</outputDirectory>
<resources>
<recource>
<directory>${project.basedir}/docker</directory>
</recource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>17</source>
<target>17</target>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
<phase>validate</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M7</version>
<configuration>
<argLine>-Xmx2048m</argLine>
</configuration>
</plugin>
<!-- Обновляем плагин install-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- переопределяем плагин site-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>4.0.0-M4</version>
</plugin>
<!-- переопределяем плагин info-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.4.1</version>
</plugin>
<!-- Подключаем плагин jacoco-maven-plugin -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.8</version>
<!-- <configuration>-->
<!-- <skip>false</skip>-->
<!-- </configuration>-->
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>generate-jacoco-report</id>
<goals>
<goal>report</goal>
</goals>
<phase>prepare-package</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
<!-- deploy-->
<!-- <dependencyManagement>-->
<!-- <snapshotRepository>-->
<!-- <id>nexus</id>-->
<!-- <url></url>-->
<!-- </snapshotRepository>-->
<!-- </dependencyManagement>-->
<!-- M2_HOME/conf - в этой папочке лежит settings.xml -->
<!-- ~/.m2/settings.xml - в этой папочке лежит settings.xml -->
<distributionManagement>
<snapshotRepository>
<id>nexus</id>
<url>http://127.0.0.1:8081/repository/maven-snapshots/</url>
</snapshotRepository>
<repository>
<id>nexus</id>
<url>http://127.0.0.1:8081/repository/maven-releases/</url>
</repository>
</distributionManagement>
</project>