From a51d8cd80c4999244b4f367933068af2b783f66f Mon Sep 17 00:00:00 2001 From: Manthan Dave Date: Sun, 31 Jan 2021 09:09:12 +0000 Subject: [PATCH 1/3] Package CLI into self-executable --- keyconnect-cli/pom.xml | 65 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/keyconnect-cli/pom.xml b/keyconnect-cli/pom.xml index 7786d90..af83aac 100644 --- a/keyconnect-cli/pom.xml +++ b/keyconnect-cli/pom.xml @@ -63,6 +63,12 @@ slf4j-simple 1.7.30 + + com.akathist.maven.plugins.launch4j + launch4j-maven-plugin + 1.7.25 + provided + @@ -75,6 +81,8 @@ jar-with-dependencies + kc + false app.keyconnect.cli.CommandLineApplication @@ -91,6 +99,63 @@ + + com.akathist.maven.plugins.launch4j + launch4j-maven-plugin + 1.7.25 + + + package + + launch4j + + + + + console + ${project.build.directory}/kc.exe + ${project.build.directory}/kc.jar + + ./jre + 15.0.2 + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + download-files + package + + run + + + + + + + + + + + + + + + + + + + From 1ee56f8ec639635d05c2c886e5f2664750c031fd Mon Sep 17 00:00:00 2001 From: Manthan Dave Date: Sun, 31 Jan 2021 09:11:46 +0000 Subject: [PATCH 2/3] Only package into executable when profile is release --- keyconnect-cli/pom.xml | 127 +++++++++++++++++++++++------------------ 1 file changed, 70 insertions(+), 57 deletions(-) diff --git a/keyconnect-cli/pom.xml b/keyconnect-cli/pom.xml index af83aac..70d37f9 100644 --- a/keyconnect-cli/pom.xml +++ b/keyconnect-cli/pom.xml @@ -99,64 +99,77 @@ - - com.akathist.maven.plugins.launch4j - launch4j-maven-plugin - 1.7.25 - - - package - - launch4j - - - - - console - ${project.build.directory}/kc.exe - ${project.build.directory}/kc.jar - - ./jre - 15.0.2 - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - download-files - package - - run - - - - - - - - - - - - - - - - - - - + + + release + + false + + + + + com.akathist.maven.plugins.launch4j + launch4j-maven-plugin + 1.7.25 + + + package + + launch4j + + + + + console + ${project.build.directory}/kc.exe + ${project.build.directory}/kc.jar + + ./jre + 15.0.2 + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + download-files + package + + run + + + + + + + + + + + + + + + + + + + + + + + + From f0f6ca640e7b496dd0db103e2c9e8c2097e24f79 Mon Sep 17 00:00:00 2001 From: Manthan Dave Date: Fri, 12 Feb 2021 15:55:19 +0000 Subject: [PATCH 3/3] Updates for building against graalvm --- build-graal.bat | 4 ++ keyconnect-api/pom.xml | 5 +- keyconnect-chainbase/pom.xml | 3 +- keyconnect-cli/pom.xml | 53 +++++++++++++++++-- .../cli/config/BaseClientConfig.java | 1 + keyconnect-rippled-api/pom.xml | 3 +- keyconnect-server/pom.xml | 3 +- 7 files changed, 64 insertions(+), 8 deletions(-) create mode 100644 build-graal.bat diff --git a/build-graal.bat b/build-graal.bat new file mode 100644 index 0000000..dd2cff5 --- /dev/null +++ b/build-graal.bat @@ -0,0 +1,4 @@ +set JAVA_HOME=C:\tools\graalvm-ce-java11-21.0.0 +set PATH=%JAVA_HOME%\bin;%PATH% +cd keyconnect-cli +mvn -DskipTests -P release package diff --git a/keyconnect-api/pom.xml b/keyconnect-api/pom.xml index 6b81a28..3d204b4 100644 --- a/keyconnect-api/pom.xml +++ b/keyconnect-api/pom.xml @@ -20,6 +20,7 @@ UTF-8 1.8 1.8 + 4.9.1 @@ -39,12 +40,12 @@ com.squareup.okhttp3 okhttp - 4.8.1 + ${okhttp.version} com.squareup.okhttp3 logging-interceptor - 4.8.1 + ${okhttp.version} com.google.code.gson diff --git a/keyconnect-chainbase/pom.xml b/keyconnect-chainbase/pom.xml index 5d9e5db..70f443d 100644 --- a/keyconnect-chainbase/pom.xml +++ b/keyconnect-chainbase/pom.xml @@ -19,6 +19,7 @@ 11 11 2.3.3.RELEASE + 4.9.1 @@ -42,7 +43,7 @@ com.squareup.okhttp3 okhttp - 4.9.0 + ${okhttp.version} app.keyconnect diff --git a/keyconnect-cli/pom.xml b/keyconnect-cli/pom.xml index 70d37f9..cca6819 100644 --- a/keyconnect-cli/pom.xml +++ b/keyconnect-cli/pom.xml @@ -26,7 +26,7 @@ info.picocli picocli - 4.5.2 + 4.6.1 app.keyconnect.api @@ -69,10 +69,40 @@ 1.7.25 provided + + org.graalvm.nativeimage + native-image-maven-plugin + 21.0.0 + provided + + + info.picocli + picocli-codegen + 4.6.1 + provided + + org.apache.maven.plugins maven-assembly-plugin @@ -111,6 +141,23 @@ + org.graalvm.nativeimage + native-image-maven-plugin + 21.0.0 + + + + native-image + + package + + + + -H:+ReportExceptionStackTraces --no-fallback --enable-all-security-services + kc + + + + <!– download file –> - + --> diff --git a/keyconnect-cli/src/main/java/app/keyconnect/cli/config/BaseClientConfig.java b/keyconnect-cli/src/main/java/app/keyconnect/cli/config/BaseClientConfig.java index 33e406b..a023e46 100644 --- a/keyconnect-cli/src/main/java/app/keyconnect/cli/config/BaseClientConfig.java +++ b/keyconnect-cli/src/main/java/app/keyconnect/cli/config/BaseClientConfig.java @@ -4,6 +4,7 @@ import app.keyconnect.api.client.BlockchainsApi; import app.keyconnect.api.client.RatesApi; import app.keyconnect.api.client.ServerApi; +import okhttp3.logging.HttpLoggingInterceptor; import org.jetbrains.annotations.NotNull; import picocli.CommandLine.Option; diff --git a/keyconnect-rippled-api/pom.xml b/keyconnect-rippled-api/pom.xml index e8e0985..d4d21cd 100644 --- a/keyconnect-rippled-api/pom.xml +++ b/keyconnect-rippled-api/pom.xml @@ -19,6 +19,7 @@ UTF-8 1.8 1.8 + 4.9.1 @@ -38,7 +39,7 @@ com.squareup.okhttp3 okhttp - 4.8.1 + ${okhttp.version} io.gsonfire diff --git a/keyconnect-server/pom.xml b/keyconnect-server/pom.xml index 0fec58c..17aec77 100644 --- a/keyconnect-server/pom.xml +++ b/keyconnect-server/pom.xml @@ -21,6 +21,7 @@ 2.3.8.RELEASE 5.3.2 app.keyconnect.server.KeyConnectApplication + 4.9.1 @@ -68,7 +69,7 @@ com.squareup.okhttp3 okhttp - 4.9.0 + ${okhttp.version} com.fasterxml.jackson.dataformat