Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate mn:graalvm-resources in favour of native:generateResourceConfig #979

Merged
merged 4 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions micronaut-maven-integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@
<writeJunitReport>true</writeJunitReport>
<properties>
<jdk.version>${java.specification.version}</jdk.version>
<!-- TODO: remove when using Micronaut 4.3 -->
<resources.autodetection.enabled>true</resources.autodetection.enabled>
</properties>
</configuration>
<executions>
Expand Down
52 changes: 25 additions & 27 deletions micronaut-maven-integration-tests/src/it/deploy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,39 +24,34 @@
<dependencies>
<dependency>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-inject</artifactId>
<artifactId>micronaut-http-server-netty</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.micronaut.validation</groupId>
<artifactId>micronaut-validation</artifactId>
<groupId>io.micronaut.serde</groupId>
<artifactId>micronaut-serde-jackson</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-http-server-netty</artifactId>
<scope>compile</scope>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-http-client</artifactId>
<scope>compile</scope>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<scope>compile</scope>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-http-client</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>runtime</scope>
<groupId>io.micronaut.test</groupId>
<artifactId>micronaut-test-junit5</artifactId>
<scope>test</scope>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.yaml</groupId>-->
<!-- <artifactId>snakeyaml</artifactId>-->
<!-- <scope>runtime</scope>-->
<!-- </dependency>-->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
Expand All @@ -67,11 +62,6 @@
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.micronaut.test</groupId>
<artifactId>micronaut-test-junit5</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand All @@ -81,6 +71,10 @@
<artifactId>micronaut-maven-plugin</artifactId>
<version>${micronaut-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand All @@ -90,9 +84,14 @@
<annotationProcessorPaths combine.children="append">
<path>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-graal</artifactId>
<artifactId>micronaut-http-validation</artifactId>
<version>${micronaut.core.version}</version>
</path>
<path>
<groupId>io.micronaut.serde</groupId>
<artifactId>micronaut-serde-processor</artifactId>
<version>${micronaut.serialization.version}</version>
</path>
</annotationProcessorPaths>
<compilerArgs>
<arg>-Amicronaut.processing.group=io.micronaut.build.examples</arg>
Expand All @@ -113,5 +112,4 @@
</plugins>
</build>


</project>
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
package io.micronaut.build.examples;

import io.micronaut.runtime.Micronaut;
import io.micronaut.build.examples.greeter.Greeter;

public class Application {

public static void main(String[] args) {
Greeter greeter = new Greeter();
System.out.println(greeter.greet("world!"));
Micronaut.run(Application.class);
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ WORKDIR /home/app

COPY classes /home/app/classes
COPY dependency/* /home/app/libs/
COPY graalvm-reachability-metadat[a] /home/app/graalvm-reachability-metadata
alvarosanchez marked this conversation as resolved.
Show resolved Hide resolved
COPY nativ[e]/generated /home/app/
COPY *.args /home/app/graalvm-native-image.args
RUN native-image @/home/app/graalvm-native-image.args -H:Class=io.micronaut.build.examples.Application -H:Name=application -cp "/home/app/libs/*:/home/app/classes/"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ENV PATH="/usr/lib/graalvm/bin:${PATH}"
WORKDIR /home/app
COPY classes /home/app/classes
COPY dependency/* /home/app/libs/
COPY graalvm-reachability-metadat[a] /home/app/graalvm-reachability-metadata
COPY nativ[e]/generated /home/app/
COPY *.args /home/app/graalvm-native-image.args
RUN native-image @/home/app/graalvm-native-image.args -H:Class=io.micronaut.function.aws.runtime.MicronautLambdaRuntime -H:Name=application -cp "/home/app/libs/*:/home/app/classes/"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ENV PATH="/usr/lib/graalvm/bin:${PATH}"
WORKDIR /home/app
COPY classes /home/app/classes
COPY dependency/* /home/app/libs/
COPY graalvm-reachability-metadat[a] /home/app/graalvm-reachability-metadata
COPY nativ[e]/generated /home/app/
COPY *.args /home/app/graalvm-native-image.args
RUN native-image @/home/app/graalvm-native-image.args -H:Class=io.micronaut.function.aws.runtime.MicronautLambdaRuntime -H:Name=application -cp "/home/app/libs/*:/home/app/classes/"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ WORKDIR /home/app

COPY classes /home/app/classes
COPY dependency/* /home/app/libs/
COPY graalvm-reachability-metadat[a] /home/app/graalvm-reachability-metadata
COPY nativ[e]/generated /home/app/
COPY *.args /home/app/graalvm-native-image.args
RUN native-image @/home/app/graalvm-native-image.args -H:Class=io.micronaut.build.examples.Application -H:Name=application -cp "/home/app/libs/*:/home/app/classes/"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ WORKDIR /home/app

COPY classes /home/app/classes
COPY dependency/* /home/app/libs/
COPY graalvm-reachability-metadat[a] /home/app/graalvm-reachability-metadata
COPY nativ[e]/generated /home/app/
COPY *.args /home/app/graalvm-native-image.args
RUN native-image @/home/app/graalvm-native-image.args -H:Class=io.micronaut.build.examples.Application -H:Name=application -cp "/home/app/libs/*:/home/app/classes/"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ WORKDIR /home/app

COPY classes /home/app/classes
COPY dependency/* /home/app/libs/
COPY graalvm-reachability-metadat[a] /home/app/graalvm-reachability-metadata
COPY nativ[e]/generated /home/app/
COPY *.args /home/app/graalvm-native-image.args
RUN native-image @/home/app/graalvm-native-image.args -H:Class=io.micronaut.build.examples.Application -H:Name=application -cp "/home/app/libs/*:/home/app/classes/"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ WORKDIR /home/app

COPY classes /home/app/classes
COPY dependency/* /home/app/libs/
COPY graalvm-reachability-metadat[a] /home/app/graalvm-reachability-metadata
COPY nativ[e]/generated /home/app/
COPY *.args /home/app/graalvm-native-image.args
RUN native-image @/home/app/graalvm-native-image.args --report-unsupported-elements-at-runtime -H:Class=com.fnproject.fn.runtime.EntryPoint -H:Name=application -cp "/home/app/libs/*:/home/app/classes/"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ WORKDIR /home/app

COPY classes /home/app/classes
COPY dependency/* /home/app/libs/
COPY graalvm-reachability-metadat[a] /home/app/graalvm-reachability-metadata
COPY nativ[e]/generated /home/app/
COPY *.args /home/app/graalvm-native-image.args
RUN native-image @/home/app/graalvm-native-image.args --static --target=linux-amd64 --libc=musl -H:Class=io.micronaut.build.examples.Application -H:Name=application -cp "/home/app/libs/*:/home/app/classes/"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
invoker.goals = -ntp mn:graalvm-resources
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?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>io.micronaut.build.examples</groupId>
<artifactId>mn-graalvm-resources-deprecated</artifactId>
<version>0.1</version>
<packaging>${packaging}</packaging>

<parent>
<groupId>io.micronaut.platform</groupId>
<artifactId>micronaut-parent</artifactId>
<version>@it.micronaut.version@</version>
</parent>

<properties>
<packaging>jar</packaging>
<micronaut.version>@it.micronaut.version@</micronaut.version>
<micronaut-maven-plugin.version>@project.version@</micronaut-maven-plugin.version>
<micronaut.runtime>netty</micronaut.runtime>
<micronaut.aot.enabled>false</micronaut.aot.enabled>
<micronaut.aot.packageName>com.example.aot.generated</micronaut.aot.packageName>
<exec.mainClass>io.micronaut.build.examples.Application</exec.mainClass>
</properties>

<repositories>
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-http-server-netty</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.micronaut.serde</groupId>
<artifactId>micronaut-serde-jackson</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-http-client</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.micronaut.test</groupId>
<artifactId>micronaut-test-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.micronaut.maven</groupId>
<artifactId>micronaut-maven-plugin</artifactId>
<configuration>
<configFile>aot-${packaging}.properties</configFile>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<!-- Uncomment to enable incremental compilation -->
<!-- <useIncrementalCompilation>false</useIncrementalCompilation> -->

<annotationProcessorPaths combine.children="append">
<path>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-http-validation</artifactId>
<version>${micronaut.core.version}</version>
</path>
<path>
<groupId>io.micronaut.serde</groupId>
<artifactId>micronaut-serde-processor</artifactId>
<version>${micronaut.serialization.version}</version>
</path>
</annotationProcessorPaths>
<compilerArgs>
<arg>-Amicronaut.processing.group=io.micronaut.build.examples</arg>
<arg>-Amicronaut.processing.module=mn-graalvm-resources-deprecated</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package io.micronaut.build.examples;

import io.micronaut.runtime.Micronaut;

public class Application {
public static void main(String[] args) {
Micronaut.run(Application.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
micronaut:
application:
name: mn-graalvm-resources-deprecated
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
File log = new File(basedir, 'build.log')
assert log.exists()
assert log.text.contains("BUILD SUCCESS")
assert log.text.contains("Goal 'graalvm-resources' is deprecated: Please use native:generateResourceConfig and/or native:generateTestResourceConfig instead.")

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading