Skip to content

Instantly share code, notes, and snippets.

@aalmiray
Created February 19, 2023 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aalmiray/cd29f719c1302bdeca3ffcc46e5ffaf5 to your computer and use it in GitHub Desktop.
Save aalmiray/cd29f719c1302bdeca3ffcc46e5ffaf5 to your computer and use it in GitHub Desktop.
Piranha Embedded JLink application
<?xml version="1.0" encoding="UTF-8"?>
<!--
SPDX-License-Identifier: Apache-2.0
Copyright 2023 Andres Almiray.
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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cloud.piranha.guides.embedded</groupId>
<artifactId>helloworld</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>Piranha Embedded JLink application</name>
<description>Piranha Embedded JLink application</description>
<properties>
<piranha.version>23.1.0</piranha.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<main.class>helloworld.HelloWorldApplication</main.class>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<release>17</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.4.0</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/modules</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<mainClass>${main.class}</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<archive>
<manifest>
<mainClass>${main.class}</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.jreleaser</groupId>
<artifactId>jreleaser-maven-plugin</artifactId>
<version>1.4.0</version>
<configuration>
<jreleaser>
<project>
<copyright>2023 Manfred Riem</copyright>
</project>
<assemble>
<jlink>
<helloworld>
<active>ALWAYS</active>
<imageName>{{distributionName}}-{{projectVersion}}</imageName>
<java>
<mainClass>${main.class}</mainClass>
</java>
<mainJar>
<path>${project.build.directory}/${project.artifactId}-${project.version}.jar</path>
</mainJar>
<jars>
<jar>
<pattern>${project.build.directory}/modules/*.jar</pattern>
</jar>
</jars>
</helloworld>
</jlink>
</assemble>
</jreleaser>
</configuration>
<executions>
<execution>
<id>assemble</id>
<phase>verify</phase>
<goals>
<goal>assemble</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>cloud.piranha</groupId>
<artifactId>piranha-embedded</artifactId>
<version>${piranha.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cloud.piranha.http</groupId>
<artifactId>piranha-http-impl</artifactId>
<version>${piranha.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cloud.piranha.http</groupId>
<artifactId>piranha-http-webapp</artifactId>
<version>${piranha.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment