Files
maven-mvnd/client/pom.xml
Tamas Cservenak ef981d5f5b Client diag option, GraalVM updates (#1042)
Changes:
* add client --diag option
* update graalvm toolchain
* update GH actions
2024-06-20 17:54:54 +02:00

250 lines
7.8 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2019 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd</artifactId>
<version>2.0.0-beta-2-SNAPSHOT</version>
</parent>
<artifactId>mvnd-client</artifactId>
<packaging>jar</packaging>
<name>Maven Daemon - Client</name>
<properties>
<graalvm-native-static-opt />
<graalvm-native-glibc-opt />
<patchelf.skip>true</patchelf.skip>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-common</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-logging</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-embedder</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
</dependency>
<dependency>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<filtering>true</filtering>
<directory>${basedir}/src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<configuration>
<locale>en_US</locale>
</configuration>
<executions>
<execution>
<goals>
<goal>create</goal>
</goals>
<phase>validate</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>default-compile</id>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>fallback-main</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<release>${maven-dist.required.jdk}</release>
<compileSourceRoots>
<root>${project.basedir}/src/main/java-fallback</root>
</compileSourceRoots>
</configuration>
</execution>
<execution>
<id>mvnd-main</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<multiReleaseOutput>true</multiReleaseOutput>
<compileSourceRoots>
<root>${project.basedir}/src/main/java-mvnd</root>
</compileSourceRoots>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<project.basedir>${project.basedir}</project.basedir>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>enable-partial-static-native</id>
<activation>
<os>
<family>!mac</family>
</os>
</activation>
<properties>
<graalvm-native-static-opt>-H:+StaticExecutableWithDynamicLibC</graalvm-native-static-opt>
</properties>
</profile>
<profile>
<id>linux-image-only-require-glibc-2.12</id>
<activation>
<os>
<family>linux</family>
</os>
<file>
<exists>target/graalvm-libs-for-glibc-2.12</exists>
</file>
</activation>
<properties>
<graalvm-native-glibc-opt>-H:CCompilerPath=${basedir}/src/main/resources/glibc/gcc
-H:CCompilerOption=-B${project.build.directory}/graalvm-libs-for-glibc-2.12
-H:CLibraryPath=${project.build.directory}/graalvm-libs-for-glibc-2.12</graalvm-native-glibc-opt>
<patchelf.skip>false</patchelf.skip>
</properties>
</profile>
<profile>
<id>native</id>
<build>
<plugins>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<configuration>
<skip>false</skip>
<mainClass>org.mvndaemon.mvnd.client.DefaultClient</mainClass>
<imageName>mvnd</imageName>
<buildArgs>--no-fallback
-H:+UnlockExperimentalVMOptions
${graalvm-native-static-opt}
${graalvm-native-glibc-opt}
-H:IncludeResources=org/mvndaemon/mvnd/.*
-H:IncludeResources=mvnd-bash-completion.bash
-H:-ParseRuntimeOptions
-H:+AddAllCharsets
-H:+ReportExceptionStackTraces
-ea</buildArgs>
</configuration>
<executions>
<execution>
<goals>
<goal>compile-no-fork</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<skip>${patchelf.skip}</skip>
<executable>patchelf</executable>
<arguments>
<argument>--add-needed</argument>
<argument>libpthread.so.0</argument>
<argument>--add-needed</argument>
<argument>librt.so.1</argument>
<argument>--add-needed</argument>
<argument>libdl.so.2</argument>
<argument>${project.build.directory}/mvnd</argument>
</arguments>
</configuration>
<executions>
<execution>
<id>add-needed-glibc-so</id>
<goals>
<goal>exec</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>