Merge pull request #4 from kneitzel/Profiles
Added profile for jlink/jpackage and updated dependencies.
This commit is contained in:
commit
15a541e8c3
@ -9,3 +9,11 @@ This project includes:
|
||||
- static code analysis with PMD and spotbugs
|
||||
- Creation of image (JLink) and app-image (JPackage)
|
||||
- Creation of native binary (GraalVM)
|
||||
|
||||
Create native executable with GraalVM use one of these:
|
||||
- ./mvnw -PGraalVM package
|
||||
- ./mvnw -DGraalVM package
|
||||
|
||||
Create image (JLink and JPackage):
|
||||
- ./mvnw -PImage package
|
||||
- ./mvnw -DImage package
|
||||
314
pom.xml
314
pom.xml
@ -26,8 +26,8 @@
|
||||
<jetbrains.annotations.version>23.0.0</jetbrains.annotations.version>
|
||||
<junit.version>5.9.1</junit.version>
|
||||
<lombok.version>1.18.24</lombok.version>
|
||||
<pmd.version>6.49.0</pmd.version>
|
||||
<spotbugs.version>4.7.2</spotbugs.version>
|
||||
<pmd.version>6.51.0</pmd.version>
|
||||
<spotbugs.version>4.7.3</spotbugs.version>
|
||||
|
||||
<!-- Plugin dependencies -->
|
||||
<codehaus.version.plugin>2.11.0</codehaus.version.plugin>
|
||||
@ -54,41 +54,6 @@
|
||||
|
||||
</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>compile-no-fork</goal>
|
||||
</goals>
|
||||
<phase>package</phase>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>test-native</id>
|
||||
<goals>
|
||||
<goal>test</goal>
|
||||
</goals>
|
||||
<phase>test</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<imageName>${appName}</imageName>
|
||||
<mainClass>${main.class}</mainClass>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
<dependencies>
|
||||
|
||||
<!-- Lombok -->
|
||||
@ -173,116 +138,6 @@
|
||||
</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>
|
||||
@ -423,4 +278,169 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>GraalVM</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>GraalVM</name>
|
||||
</property>
|
||||
</activation>
|
||||
<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>compile-no-fork</goal>
|
||||
</goals>
|
||||
<phase>package</phase>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>test-native</id>
|
||||
<goals>
|
||||
<goal>test</goal>
|
||||
</goals>
|
||||
<phase>test</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<imageName>${appName}</imageName>
|
||||
<mainClass>${main.class}</mainClass>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>Image</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>Image</name>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- 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>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
</profiles>
|
||||
|
||||
</project>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user