203 lines
5.2 KiB
XML
203 lines
5.2 KiB
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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
<modelVersion>4.0.0</modelVersion>
|
|
<groupId>de.hs_mannheim</groupId>
|
|
<artifactId>MvnDemo</artifactId>
|
|
<version>0.0.1-SNAPSHOT</version>
|
|
|
|
<properties>
|
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
<maven.compiler.source>21</maven.compiler.source>
|
|
<maven.compiler.target>21</maven.compiler.target>
|
|
</properties>
|
|
|
|
<dependencies>
|
|
<dependency>
|
|
<groupId>org.junit.jupiter</groupId>
|
|
<artifactId>junit-jupiter-api</artifactId>
|
|
<version>5.8.1</version>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.junit.jupiter</groupId>
|
|
<artifactId>junit-jupiter-engine</artifactId>
|
|
<version>5.8.1</version>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.apache.logging.log4j</groupId>
|
|
<artifactId>log4j-core</artifactId>
|
|
<version>2.24.2</version>
|
|
</dependency>
|
|
</dependencies>
|
|
|
|
<build>
|
|
<plugins>
|
|
|
|
<!-- Compiler -->
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-compiler-plugin</artifactId>
|
|
<version>3.13.0</version>
|
|
<configuration>
|
|
<source>${maven.compiler.source}</source>
|
|
<target>${maven.compiler.target}</target>
|
|
</configuration>
|
|
</plugin>
|
|
|
|
<!-- Testing -->
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-surefire-plugin</artifactId>
|
|
<version>3.5.3</version>
|
|
<configuration>
|
|
<includes>
|
|
<include>**/*Test.java</include>
|
|
</includes>
|
|
<excludes>
|
|
<exclude>**/IntegrationTest.java</exclude>
|
|
</excludes>
|
|
<parallel>classes</parallel>
|
|
<threadCount>4</threadCount>
|
|
</configuration>
|
|
</plugin>
|
|
|
|
<!-- JAR creation -->
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-shade-plugin</artifactId>
|
|
<version>3.6.0</version>
|
|
<configuration>
|
|
<createDependencyReducedPom>false</createDependencyReducedPom>
|
|
</configuration>
|
|
<executions>
|
|
<execution>
|
|
<phase>package</phase>
|
|
<goals>
|
|
<goal>shade</goal>
|
|
</goals>
|
|
<configuration>
|
|
<shadedArtifactAttached>false</shadedArtifactAttached>
|
|
<transformers>
|
|
<transformer
|
|
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
|
<mainClass>de.hs_mannheim.informatik.mvn.Main</mainClass>
|
|
</transformer>
|
|
</transformers>
|
|
</configuration>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
|
|
<!-- Code Obfuscation -->
|
|
<plugin>
|
|
<groupId>com.github.wvengen</groupId>
|
|
<artifactId>proguard-maven-plugin</artifactId>
|
|
<version>2.6.1</version>
|
|
<executions>
|
|
<execution>
|
|
<phase>package</phase>
|
|
<goals>
|
|
<goal>proguard</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
<configuration>
|
|
<!-- WICHTIG: Das injar ist das vom Shade-Plugin erzeugte
|
|
Jar -->
|
|
<injar>${project.build.finalName}.jar</injar>
|
|
<!-- Das outjar ist das finale, geschützte Jar -->
|
|
<outjar>${project.build.finalName}-protected.jar</outjar>
|
|
<obfuscate>true</obfuscate>
|
|
<options>
|
|
<option>-keep public class de.hs_mannheim.informatik.mvn.Main {
|
|
public static void main(java.lang.String[]);
|
|
}
|
|
</option>
|
|
<option>-keepclassmembers enum * {
|
|
public static **[] values();
|
|
public static ** valueOf(java.lang.String);
|
|
}
|
|
</option>
|
|
<!-- Da Shade alle Libs zusammenfügt, brauchst du oft
|
|
mehr -dontwarn Regeln -->
|
|
<option>-dontwarn **</option>
|
|
</options>
|
|
<libs>
|
|
<lib>${java.home}/jmods</lib>
|
|
</libs>
|
|
</configuration>
|
|
</plugin>
|
|
|
|
<!-- Code coverage, cf.: target/site/jacoco -->
|
|
<plugin>
|
|
<groupId>org.jacoco</groupId>
|
|
<artifactId>jacoco-maven-plugin</artifactId>
|
|
<version>0.8.12</version>
|
|
<executions>
|
|
<execution>
|
|
<goals>
|
|
<goal>prepare-agent</goal>
|
|
</goals>
|
|
</execution>
|
|
<execution>
|
|
<id>report</id>
|
|
<phase>test</phase>
|
|
<goals>
|
|
<goal>report</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
|
|
<!-- Static code analysis, cf: target/site/pmd.html -->
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-pmd-plugin</artifactId>
|
|
<version>3.26.0</version>
|
|
<configuration>
|
|
<failOnViolation>false</failOnViolation>
|
|
<printFailingErrors>true</printFailingErrors>
|
|
</configuration>
|
|
<executions>
|
|
<execution>
|
|
<phase>verify</phase>
|
|
<goals>
|
|
<goal>check</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
|
|
</plugins>
|
|
|
|
</build>
|
|
|
|
<reporting>
|
|
<plugins>
|
|
<!-- generate Javadocs via "mvn site" and find them in the site
|
|
folder-->
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-javadoc-plugin</artifactId>
|
|
<version>3.11.2</version>
|
|
<configuration>
|
|
<show>private</show>
|
|
<nohelp>true</nohelp>
|
|
</configuration>
|
|
</plugin>
|
|
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-checkstyle-plugin</artifactId>
|
|
<version>3.6.0</version>
|
|
</plugin>
|
|
|
|
</plugins>
|
|
|
|
</reporting>
|
|
|
|
</project> |