425 lines
18 KiB
XML
425 lines
18 KiB
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>de.kneitzel</groupId>
|
|
<artifactId>javaapp</artifactId>
|
|
<version>1.0-SNAPSHOT</version>
|
|
|
|
<organization>
|
|
<name>Java Forum</name>
|
|
</organization>
|
|
|
|
<properties>
|
|
<!-- Application Properties -->
|
|
<link.name>${project.artifactId}</link.name>
|
|
<launcher>${project.artifactId}</launcher>
|
|
<appName>${project.artifactId}</appName>
|
|
<main.class>de.kneitzel.JavaApp</main.class>
|
|
<main.module>AppModule</main.module>
|
|
<java.version>17</java.version>
|
|
<required.maven.version>3.6.3</required.maven.version>
|
|
|
|
<!-- Dependency versions -->
|
|
<jetbrains.annotations.version>23.0.0</jetbrains.annotations.version>
|
|
<junit.version>5.8.2</junit.version>
|
|
<lombok.version>1.18.24</lombok.version>
|
|
<pmd.version>6.47.0</pmd.version>
|
|
<spotbugs.version>4.7.1</spotbugs.version>
|
|
|
|
<!-- Plugin dependencies -->
|
|
<codehaus.version.plugin>2.11.0</codehaus.version.plugin>
|
|
<jpackage.maven.plugin>0.1.3</jpackage.maven.plugin>
|
|
<maven.clean.plugin>3.2.0</maven.clean.plugin>
|
|
<maven.compiler.plugin>3.10.1</maven.compiler.plugin>
|
|
<maven.dependency.plugin>3.3.0</maven.dependency.plugin>
|
|
<maven.deploy.plugin>3.0.0-M2</maven.deploy.plugin>
|
|
<maven.enforcer.plugin>3.1.0</maven.enforcer.plugin>
|
|
<maven.install.plugin>3.0.0-M1</maven.install.plugin>
|
|
<maven.jar.plugin>3.2.2</maven.jar.plugin>
|
|
<maven.pmd.plugin>3.16.0</maven.pmd.plugin>
|
|
<maven.resources.plugin>3.2.0</maven.resources.plugin>
|
|
<maven.site.plugin>4.0.0-M1</maven.site.plugin>
|
|
<maven.surfire.plugin>3.0.0-M6</maven.surfire.plugin>
|
|
<moditect.maven.plugin>1.0.0.RC2</moditect.maven.plugin>
|
|
<native.maven.plugin>0.9.17</native.maven.plugin>
|
|
<spotbugs.maven.plugin>4.7.1.0</spotbugs.maven.plugin>
|
|
|
|
<!-- other properties -->
|
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
<maven.compiler.source>${java.version}</maven.compiler.source>
|
|
<maven.compiler.target>${java.version}</maven.compiler.target>
|
|
|
|
</properties>
|
|
|
|
<profiles>
|
|
<profile>
|
|
<id>native</id>
|
|
<build>
|
|
<plugins>
|
|
<plugin>
|
|
<groupId>org.graalvm.buildtools</groupId>
|
|
<artifactId>native-maven-plugin</artifactId>
|
|
<version>${native.maven.plugin}</version>
|
|
<extensions>true</extensions>
|
|
<executions>
|
|
<execution>
|
|
<id>build-native</id>
|
|
<goals>
|
|
<goal>build</goal>
|
|
</goals>
|
|
<phase>package</phase>
|
|
</execution>
|
|
<execution>
|
|
<id>test-native</id>
|
|
<goals>
|
|
<goal>test</goal>
|
|
</goals>
|
|
<phase>test</phase>
|
|
</execution>
|
|
</executions>
|
|
<configuration>
|
|
<!-- ... -->
|
|
</configuration>
|
|
</plugin>
|
|
</plugins>
|
|
</build>
|
|
</profile>
|
|
</profiles>
|
|
<dependencies>
|
|
|
|
<!-- Lombok -->
|
|
<dependency>
|
|
<groupId>org.projectlombok</groupId>
|
|
<artifactId>lombok</artifactId>
|
|
<version>${lombok.version}</version>
|
|
<scope>provided</scope>
|
|
</dependency>
|
|
|
|
<!-- JUnit 5 -->
|
|
<dependency>
|
|
<groupId>org.junit.jupiter</groupId>
|
|
<artifactId>junit-jupiter-engine</artifactId>
|
|
<version>${junit.version}</version>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.junit.jupiter</groupId>
|
|
<artifactId>junit-jupiter-params</artifactId>
|
|
<version>${junit.version}</version>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
|
|
<!-- Dependency used for @NotNull / @Nullable -->
|
|
<dependency>
|
|
<groupId>org.jetbrains</groupId>
|
|
<artifactId>annotations</artifactId>
|
|
<version>${jetbrains.annotations.version}</version>
|
|
<scope>compile</scope>
|
|
</dependency>
|
|
</dependencies>
|
|
|
|
<build>
|
|
<plugins>
|
|
<!-- Enforcer to enforce min Maven version -->
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-enforcer-plugin</artifactId>
|
|
<version>${maven.enforcer.plugin}</version>
|
|
<executions>
|
|
<execution>
|
|
<id>enforce-versions</id>
|
|
<goals>
|
|
<goal>enforce</goal>
|
|
</goals>
|
|
<configuration>
|
|
<rules>
|
|
<requireMavenVersion>
|
|
<version>${required.maven.version}</version>
|
|
</requireMavenVersion>
|
|
</rules>
|
|
</configuration>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
|
|
<!-- Compiler including Lobok -->
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-compiler-plugin</artifactId>
|
|
<version>${maven.compiler.plugin}</version>
|
|
<configuration>
|
|
<release>${java.version}</release>
|
|
<annotationProcessorPaths>
|
|
<path>
|
|
<groupId>org.projectlombok</groupId>
|
|
<artifactId>lombok</artifactId>
|
|
<version>${lombok.version}</version>
|
|
</path>
|
|
</annotationProcessorPaths>
|
|
</configuration>
|
|
</plugin>
|
|
|
|
<!--Test execution -->
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-surefire-plugin</artifactId>
|
|
<version>${maven.surfire.plugin}</version>
|
|
<configuration>
|
|
<testFailureIgnore>true</testFailureIgnore>
|
|
</configuration>
|
|
</plugin>
|
|
|
|
<!-- Copy dependencies -->
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-dependency-plugin</artifactId>
|
|
<version>${maven.dependency.plugin}</version>
|
|
<executions>
|
|
<execution>
|
|
<id>copy-dependencies</id>
|
|
<phase>package</phase>
|
|
<goals>
|
|
<goal>copy-dependencies</goal>
|
|
</goals>
|
|
<configuration>
|
|
<outputDirectory>${project.build.directory}/modules</outputDirectory>
|
|
<overWriteReleases>false</overWriteReleases>
|
|
<overWriteSnapshots>false</overWriteSnapshots>
|
|
<overWriteIfNewer>true</overWriteIfNewer>
|
|
</configuration>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
|
|
<!-- Build image -->
|
|
<plugin>
|
|
<groupId>org.moditect</groupId>
|
|
<artifactId>moditect-maven-plugin</artifactId>
|
|
<version>${moditect.maven.plugin}</version>
|
|
<executions>
|
|
<execution>
|
|
<id>add-module-info-to-dependencies</id>
|
|
<phase>package</phase>
|
|
<configuration>
|
|
<outputDirectory>${project.build.directory}/modules</outputDirectory>
|
|
<overwriteExistingFiles>true</overwriteExistingFiles>
|
|
<!-- Beispiel wie eine Dependency ohne module-info diese bekommen kann! -->
|
|
<!--
|
|
<modules>
|
|
<module>
|
|
<artifact>
|
|
<groupId>org.json</groupId>
|
|
<artifactId>json</artifactId>
|
|
</artifact>
|
|
<moduleInfo>
|
|
<name>org.json</name>
|
|
</moduleInfo>
|
|
</module>
|
|
</modules>
|
|
-->
|
|
|
|
<module>
|
|
<mainClass>${main.class}</mainClass>
|
|
<moduleInfoFile>${project.build.sourceDirectory}/module-info.java</moduleInfoFile>
|
|
</module>
|
|
|
|
<jdepsExtraArgs>
|
|
--ignore-missing-deps
|
|
</jdepsExtraArgs>
|
|
</configuration>
|
|
<goals>
|
|
<goal>add-module-info</goal>
|
|
</goals>
|
|
</execution>
|
|
<execution>
|
|
<id>create-runtime-image</id>
|
|
<phase>package</phase>
|
|
<goals>
|
|
<goal>create-runtime-image</goal>
|
|
</goals>
|
|
<configuration>
|
|
<modulePath>
|
|
<path>${project.build.directory}/modules</path>
|
|
</modulePath>
|
|
<modules>
|
|
<module>${main.module}</module>
|
|
</modules>
|
|
<launcher>
|
|
<name>${launcher}</name>
|
|
<module>${main.module}</module>
|
|
</launcher>
|
|
<compression>2</compression>
|
|
<stripDebug>true</stripDebug>
|
|
<outputDirectory>${project.build.directory}/jlink-image</outputDirectory>
|
|
<jarInclusionPolicy>APP_WITH_DEPENDENCIES</jarInclusionPolicy>
|
|
</configuration>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
|
|
<!-- Build JPackage App-Image -->
|
|
<plugin>
|
|
<groupId>com.github.akman</groupId>
|
|
<artifactId>jpackage-maven-plugin</artifactId>
|
|
<version>${jpackage.maven.plugin}</version>
|
|
<executions>
|
|
<execution>
|
|
<phase>package</phase>
|
|
<goals>
|
|
<goal>jpackage</goal>
|
|
</goals>
|
|
<configuration>
|
|
<name>${appName}</name>
|
|
<type>IMAGE</type>
|
|
<runtimeimage>${project.build.directory}/jlink-image</runtimeimage>
|
|
<module>${main.module}/${main.class}</module>
|
|
</configuration>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
|
|
<!-- Spotbugs Code Analyzer -->
|
|
<plugin>
|
|
<groupId>com.github.spotbugs</groupId>
|
|
<artifactId>spotbugs-maven-plugin</artifactId>
|
|
<version>${spotbugs.maven.plugin}</version>
|
|
<dependencies>
|
|
<!-- overwrite dependency on spotbugs if you want to specify the version of spotbugs -->
|
|
<dependency>
|
|
<groupId>com.github.spotbugs</groupId>
|
|
<artifactId>spotbugs</artifactId>
|
|
<version>${spotbugs.version}</version>
|
|
</dependency>
|
|
</dependencies>
|
|
<executions>
|
|
<execution>
|
|
<phase>prepare-package</phase>
|
|
<goals>
|
|
<!-- pmd does not stop build when violations are found -->
|
|
<goal>spotbugs</goal>
|
|
|
|
<!-- check stops the build when violations are found -->
|
|
<!-- <goal>check</goal> -->
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
<configuration>
|
|
<excludeFilterFile>spotbugs-exclude-filter.xml</excludeFilterFile>
|
|
</configuration>
|
|
</plugin>
|
|
|
|
<!-- PMD static code analysis -->
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-pmd-plugin</artifactId>
|
|
<version>${maven.pmd.plugin}</version>
|
|
<dependencies>
|
|
<dependency>
|
|
<groupId>net.sourceforge.pmd</groupId>
|
|
<artifactId>pmd-core</artifactId>
|
|
<version>${pmd.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>net.sourceforge.pmd</groupId>
|
|
<artifactId>pmd-java</artifactId>
|
|
<version>${pmd.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>net.sourceforge.pmd</groupId>
|
|
<artifactId>pmd-javascript</artifactId>
|
|
<version>${pmd.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>net.sourceforge.pmd</groupId>
|
|
<artifactId>pmd-jsp</artifactId>
|
|
<version>${pmd.version}</version>
|
|
</dependency>
|
|
</dependencies>
|
|
<configuration>
|
|
<sourceEncoding>${project.build.sourceEncoding}</sourceEncoding>
|
|
<minimumTokens>100</minimumTokens>
|
|
<targetJdk>${java.version}</targetJdk>
|
|
<rulesets>
|
|
<ruleset>pmd-ruleset.xml</ruleset>
|
|
</rulesets>
|
|
<linkXRef>false</linkXRef>
|
|
</configuration>
|
|
<executions>
|
|
<execution>
|
|
<phase>prepare-package</phase>
|
|
<goals>
|
|
<!-- pmd does not stop build when violations are found -->
|
|
<goal>pmd</goal>
|
|
|
|
<!-- check stops the build when violations are found -->
|
|
<!-- <goal>check</goal> -->
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
|
|
<!-- Check for new versions in dependencies -->
|
|
<plugin>
|
|
<groupId>org.codehaus.mojo</groupId>
|
|
<artifactId>versions-maven-plugin</artifactId>
|
|
<version>${codehaus.version.plugin}</version>
|
|
<executions>
|
|
<execution>
|
|
<phase>validate</phase>
|
|
<goals>
|
|
<goal>display-dependency-updates</goal>
|
|
<goal>display-plugin-updates</goal>
|
|
<goal>display-property-updates</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
|
|
<!-- clean plugin - to remove the warning regarding version -->
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-clean-plugin</artifactId>
|
|
<version>${maven.clean.plugin}</version>
|
|
</plugin>
|
|
|
|
<!-- deploy plugin - to remove the warning regarding version -->
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-deploy-plugin</artifactId>
|
|
<version>${maven.deploy.plugin}</version>
|
|
</plugin>
|
|
|
|
<!-- install plugin - to remove the warning regarding version -->
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-install-plugin</artifactId>
|
|
<version>${maven.install.plugin}</version>
|
|
</plugin>
|
|
|
|
<!-- jar plugin - to remove the warning regarding version -->
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-jar-plugin</artifactId>
|
|
<version>${maven.jar.plugin}</version>
|
|
</plugin>
|
|
|
|
<!-- resources plugin - to remove the warning regarding version -->
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-resources-plugin</artifactId>
|
|
<version>${maven.resources.plugin}</version>
|
|
</plugin>
|
|
|
|
<!-- site plugin - to remove the warning regarding version -->
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-site-plugin</artifactId>
|
|
<version>${maven.site.plugin}</version>
|
|
</plugin>
|
|
</plugins>
|
|
</build>
|
|
</project>
|