diff --git a/jOOQ-examples/jOOQ-picocli-native-image-example/pom.xml b/jOOQ-examples/jOOQ-picocli-native-image-example/pom.xml new file mode 100644 index 0000000000..b218ec4b9b --- /dev/null +++ b/jOOQ-examples/jOOQ-picocli-native-image-example/pom.xml @@ -0,0 +1,100 @@ + + + 4.0.0 + + + org.jooq + jooq-examples + 3.18.0-SNAPSHOT + + + jooq-picocli-native-image + jOOQ PicoCLI native image Example + + + org.jooq.example.picocli.Main + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + 17 + + + + 17 + 17 + + + + info.picocli + picocli-codegen + 4.1.4 + + + + -Aproject=${project.groupId}/${project.artifactId} + + + + + + org.graalvm.nativeimage + native-image-maven-plugin + 20.1.0 + + + + native-image + + package + + + + ${project.name} + ${mainClass} + + + + + org.apache.maven.plugins + maven-assembly-plugin + 3.4.2 + + + + jar-with-dependencies + + + + ${mainClass} + + + + + + + + + + info.picocli + picocli + 4.7.1 + + + org.jooq + jooq + + + org.graalvm.nativeimage + svm + 22.3.1 + + + \ No newline at end of file diff --git a/jOOQ-examples/jOOQ-picocli-native-image-example/src/main/java/org/jooq/example/picocli/Main.java b/jOOQ-examples/jOOQ-picocli-native-image-example/src/main/java/org/jooq/example/picocli/Main.java new file mode 100644 index 0000000000..de386469d8 --- /dev/null +++ b/jOOQ-examples/jOOQ-picocli-native-image-example/src/main/java/org/jooq/example/picocli/Main.java @@ -0,0 +1,23 @@ +package org.jooq.example.picocli; + +import org.jooq.CloseableDSLContext; +import org.jooq.impl.DSL; +import picocli.CommandLine; +import picocli.CommandLine.Command; + +import java.sql.SQLException; + +@Command +public class Main implements Runnable { + + public static void main(String[] args) { + new CommandLine(new Main()).execute(args); + } + + @Override + public void run() { + try (CloseableDSLContext ctx = DSL.using("jdbc:h2:mem:jooq-example-picocli", "sa", "")) { + System.out.println(ctx.fetch("select 1")); + } + } +}