M1-AP02: Build-Infrastruktur härten (SLF4J, JaCoCo, PIT, JAR-Plugin,
Mockito-Agent)
This commit is contained in:
143
pom.xml
143
pom.xml
@@ -6,40 +6,59 @@
|
||||
<groupId>de.gecheckt</groupId>
|
||||
<artifactId>asv-format-validator</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
|
||||
|
||||
<properties>
|
||||
<!-- Java Version -->
|
||||
<maven.compiler.release>21</maven.compiler.release>
|
||||
|
||||
|
||||
<!-- Encoding -->
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
|
||||
|
||||
<!-- Dependency Versions -->
|
||||
<log4j.version>2.20.0</log4j.version>
|
||||
<slf4j.version>2.0.7</slf4j.version>
|
||||
<junit.version>5.9.2</junit.version>
|
||||
<mockito.version>5.23.0</mockito.version>
|
||||
|
||||
|
||||
<!-- Plugin Versions -->
|
||||
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
|
||||
<maven-dependency-plugin.version>3.6.0</maven-dependency-plugin.version>
|
||||
<maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
|
||||
<maven-surefire-plugin.version>3.0.0</maven-surefire-plugin.version>
|
||||
<jacoco-maven-plugin.version>0.8.10</jacoco-maven-plugin.version>
|
||||
</properties>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<!-- Log4j2 API -->
|
||||
<!-- SLF4J API (Logging-Fassade; Bindung an Log4j2 erfolgt zur Laufzeit) -->
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>${slf4j.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Log4j2-SLF4J-Bridge (Runtime-Bindung: SLF4J → Log4j2) -->
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-slf4j2-impl</artifactId>
|
||||
<version>${log4j.version}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Log4j2 API (bis AP04 direkt genutzt; danach nur noch indirekt via SLF4J) -->
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-api</artifactId>
|
||||
<version>${log4j.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Log4j2 Core -->
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-core</artifactId>
|
||||
<version>${log4j.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- JUnit 5 für Tests -->
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
@@ -47,7 +66,7 @@
|
||||
<version>${junit.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Mockito für Mocking in Tests -->
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
@@ -56,7 +75,7 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
@@ -67,12 +86,112 @@
|
||||
<release>21</release>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Löst Jar-Pfade für Dependencies auf; liefert u.a. den Pfad
|
||||
zum Mockito-Core-JAR für den expliziten Java-Agent in Surefire -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>${maven-dependency-plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>get-mockito-agent-path</id>
|
||||
<goals>
|
||||
<goal>properties</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire-plugin.version}</version>
|
||||
<configuration>
|
||||
<!-- @{argLine} wird von JaCoCo prepare-agent (Late-Binding) befüllt.
|
||||
Mockito wird als expliziter Java-Agent eingehängt, um die
|
||||
ByteBuddy-Self-Attach-Warnung zu vermeiden (AP01, Rest-Risiko 2). -->
|
||||
<argLine>@{argLine} -javaagent:${org.mockito:mockito-core:jar}</argLine>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- Ausführbares JAR; Main-Class-Klasse wird in AP06 angelegt -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>${maven-jar-plugin.version}</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>de.gecheckt.asv.bootstrap.Main</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- JaCoCo: Coverage-Messung ohne Schwellwerte (Schwellen kommen in M9) -->
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<version>${jacoco-maven-plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>jacoco-prepare-agent</id>
|
||||
<goals>
|
||||
<goal>prepare-agent</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>jacoco-report</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>report</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
<profiles>
|
||||
<!-- Mutation-Tests via PIT; aktiviert mit: mvn -P mutation test
|
||||
Schwellwerte werden erst in M9 gesetzt. -->
|
||||
<profile>
|
||||
<id>mutation</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.pitest</groupId>
|
||||
<artifactId>pitest-maven</artifactId>
|
||||
<version>1.15.3</version>
|
||||
<dependencies>
|
||||
<!-- JUnit 5 Adapter für PIT (ohne dieses Plugin kann PIT keine JUnit-5-Tests laufen lassen) -->
|
||||
<dependency>
|
||||
<groupId>org.pitest</groupId>
|
||||
<artifactId>pitest-junit5-plugin</artifactId>
|
||||
<version>1.2.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<configuration>
|
||||
<targetClasses>
|
||||
<param>de.gecheckt.asv.*</param>
|
||||
</targetClasses>
|
||||
<targetTests>
|
||||
<param>de.gecheckt.asv.*</param>
|
||||
</targetTests>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>pit-mutation</id>
|
||||
<phase>test</phase>
|
||||
<goals>
|
||||
<goal>mutationCoverage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
||||
Reference in New Issue
Block a user