From 2a8467c0de19afbe9cc0d689e43ce3711f1ee1ba Mon Sep 17 00:00:00 2001 From: Ralf Pannemans Date: Thu, 23 Mar 2023 13:42:07 +0100 Subject: [PATCH] Provide BP_JVM_VERSION for all Java samples --- java/akka/README.md | 4 +++- java/application-insights/README.md | 4 +++- java/aspectj/README.md | 4 +++- java/deps/README.md | 4 +++- java/dist-zip/README.md | 4 +++- java/gradle/README.md | 8 +++++--- java/jar/README.md | 4 +++- java/kotlin/README.md | 4 +++- java/leiningen/README.md | 4 +++- java/maven/README.md | 8 +++++--- java/native-image/java-native-image-sample/README.md | 8 ++++++-- java/native-image/quarkus-native/README.md | 5 +++-- java/opentelemetry/README.md | 5 ++++- java/tools-build/README.md | 2 ++ java/war/README.md | 4 +++- 15 files changed, 52 insertions(+), 20 deletions(-) diff --git a/java/akka/README.md b/java/akka/README.md index de446f9d..9bb2fc15 100644 --- a/java/akka/README.md +++ b/java/akka/README.md @@ -1,9 +1,11 @@ # Scala Akka Sample Application +See [prerequisites](https://paketo.io/docs/howto/java/#prerequisites) of this sample. + ## Building ```bash -pack build applications/akka +pack build applications/akka --env BP_JVM_VERSION=8 ``` ## Running diff --git a/java/application-insights/README.md b/java/application-insights/README.md index 5a90e192..43608117 100644 --- a/java/application-insights/README.md +++ b/java/application-insights/README.md @@ -1,5 +1,7 @@ # Java Azure Application Insights Sample Application +See [prerequisites](https://paketo.io/docs/howto/java/#prerequisites) of this sample. + ## Binding The buildpack installs the Azure Application Insights Agent, and configures it for usage based on a Service Binding. This binding consists of a `type` indicating what type of service it is, and an `InstrumentationKey` with the Application Insight Instrumentation Key. @@ -19,7 +21,7 @@ echo "" > binding/InstrumentationKey ## Building ```bash -pack build applications/application-insights --volume "$(pwd)/binding:/platform/bindings/application-insights" +pack build applications/application-insights --env BP_JVM_VERSION=11 --volume "$(pwd)/binding:/platform/bindings/application-insights" ``` ## Running diff --git a/java/aspectj/README.md b/java/aspectj/README.md index 1db15897..082009cc 100644 --- a/java/aspectj/README.md +++ b/java/aspectj/README.md @@ -1,9 +1,11 @@ # Java AspectJ Sample Application +See [prerequisites](https://paketo.io/docs/howto/java/#prerequisites) of this sample. + ## Building ```bash -pack build applications/aspectj +pack build applications/aspectj --env BP_JVM_VERSION=11 ``` ## Running diff --git a/java/deps/README.md b/java/deps/README.md index 1e2b3022..ec06ca77 100644 --- a/java/deps/README.md +++ b/java/deps/README.md @@ -1,9 +1,11 @@ # Clojure Deps Sample Application +See [prerequisites](https://paketo.io/docs/howto/java/#prerequisites) of this sample. + ## Building ```bash -pack build applications/clojure-deps +pack build applications/clojure-deps --env BP_JVM_VERSION=8 ``` ## Running diff --git a/java/dist-zip/README.md b/java/dist-zip/README.md index 8ec2c3b1..58a2e89f 100644 --- a/java/dist-zip/README.md +++ b/java/dist-zip/README.md @@ -1,9 +1,11 @@ # Java Dist-Zip Sample Application +See [prerequisites](https://paketo.io/docs/howto/java/#prerequisites) of this sample. + ## Building ```bash -pack build applications/dist-zip --env BP_GRADLE_BUILD_ARGUMENTS="--no-daemon -x test bootDistZip" --env BP_GRADLE_BUILT_ARTIFACT="build/distributions/*.zip" +pack build applications/dist-zip --env BP_GRADLE_BUILD_ARGUMENTS="--no-daemon -x test bootDistZip" --env BP_GRADLE_BUILT_ARTIFACT="build/distributions/*.zip" --env BP_JVM_VERSION=17 ``` ## Running diff --git a/java/gradle/README.md b/java/gradle/README.md index 521b4638..a67bb7ce 100644 --- a/java/gradle/README.md +++ b/java/gradle/README.md @@ -1,22 +1,24 @@ # Java Gradle Sample Application +See [prerequisites](https://paketo.io/docs/howto/java/#prerequisites) of this sample. + ## Building ```bash -pack build applications/gradle +pack build applications/gradle --env BP_JVM_VERSION=17 ``` Alternatively, if you want to attach a `gradle.properties` file to pass additional configuration to Gradle. ```bash -pack build --volume $(pwd)/bindings:/platform/bindings applications/gradle +pack build applications/gradle --volume $(pwd)/bindings:/platform/bindings --env BP_JVM_VERSION=17 ``` The command above will use the sample `gradle.properties` file from this repo. It may be more useful to copy your local `gradle.properties` file first. ```bash cp ~/.gradle/gradle.properties java/gradle/bindings/gradle/gradle.properties -pack build applications/gradle --volume $(pwd)/bindings:/platform/bindings +pack build applications/gradle --volume $(pwd)/bindings:/platform/bindings --env BP_JVM_VERSION=17 ``` ## Running diff --git a/java/jar/README.md b/java/jar/README.md index faaf7802..bb626c6d 100644 --- a/java/jar/README.md +++ b/java/jar/README.md @@ -1,9 +1,11 @@ # Pre-compiled Java Sample Application +See [prerequisites](https://paketo.io/docs/howto/java/#prerequisites) of this sample. + ## Building ```bash -pack build applications/jar +pack build applications/jar --env BP_JVM_VERSION=8 ``` ## Running diff --git a/java/kotlin/README.md b/java/kotlin/README.md index 10e615a6..d4e9134e 100644 --- a/java/kotlin/README.md +++ b/java/kotlin/README.md @@ -1,9 +1,11 @@ # Kotlin Sample Application +See [prerequisites](https://paketo.io/docs/howto/java/#prerequisites) of this sample. + ## Building ```bash -pack build applications/kotlin +pack build applications/kotlin --env BP_JVM_VERSION=8 ``` ## Running diff --git a/java/leiningen/README.md b/java/leiningen/README.md index 8212bb6c..12a1ed64 100644 --- a/java/leiningen/README.md +++ b/java/leiningen/README.md @@ -1,9 +1,11 @@ # Clojure Leiningen Sample Application +See [prerequisites](https://paketo.io/docs/howto/java/#prerequisites) of this sample. + ## Building ```bash -pack build applications/leiningen +pack build applications/leiningen --env BP_JVM_VERSION=8 ``` ## Running diff --git a/java/maven/README.md b/java/maven/README.md index 6da0eeb1..34bae64a 100644 --- a/java/maven/README.md +++ b/java/maven/README.md @@ -1,22 +1,24 @@ # Java Maven Sample Application +See [prerequisites](https://paketo.io/docs/howto/java/#prerequisites) of this sample. + ## Building ```bash -pack build applications/maven --builder paketobuildpacks/builder-jammy-base -e BP_JVM_VERSION=17 +pack build applications/maven --env BP_JVM_VERSION=17 ``` Alternatively, if you want to attach a Maven `settings.xml` file to pass additional configuration to Maven. ```bash -pack build applications/maven --builder paketobuildpacks/builder-jammy-base -e BP_JVM_VERSION=17 --volume $(pwd)/bindings:/platform/bindings +pack build applications/maven --env BP_JVM_VERSION=17 --volume $(pwd)/bindings:/platform/bindings ``` The command above will use the sample `settings.xml` file from this repo. It may be more useful to copy your local `settings.xml` first. ```bash cp ~/.m2/settings.xml java/maven/bindings/maven/settings.xml -pack build applications/maven --volume $(pwd)/bindings:/platform/bindings +pack build applications/maven --env BP_JVM_VERSION=17 --volume $(pwd)/bindings:/platform/bindings ``` ## Running diff --git a/java/native-image/java-native-image-sample/README.md b/java/native-image/java-native-image-sample/README.md index b5618aab..a389d71b 100644 --- a/java/native-image/java-native-image-sample/README.md +++ b/java/native-image/java-native-image-sample/README.md @@ -3,18 +3,22 @@ ## Building ### With `pack` + ```bash pack build applications/native-image \ --builder paketobuildpacks/builder:tiny \ - --env BP_NATIVE_IMAGE=true + --env BP_NATIVE_IMAGE=true \ + --env BP_JVM_VERSION=17 ``` ### With the Spring Boot Maven Plugin -``` + +```bash ./mvnw -Dmaven.test.skip=true spring-boot:build-image ``` ## Running + ```bash docker run --rm --tty --publish 8080:8080 applications/native-image ``` diff --git a/java/native-image/quarkus-native/README.md b/java/native-image/quarkus-native/README.md index e09261f1..fc1a2f85 100644 --- a/java/native-image/quarkus-native/README.md +++ b/java/native-image/quarkus-native/README.md @@ -11,7 +11,8 @@ pack build applications/quarkus-native \ --env BP_MAVEN_BUILD_ARGUMENTS="-Dquarkus.package.type=native-sources -Dmaven.test.skip=true package" \ --env BP_MAVEN_BUILT_ARTIFACT="target/native-sources" \ --env BP_NATIVE_IMAGE_BUILD_ARGUMENTS_FILE="native-sources/native-image.args" \ - --env BP_NATIVE_IMAGE_BUILT_ARTIFACT="native-sources/getting-started-*-runner.jar" + --env BP_NATIVE_IMAGE_BUILT_ARTIFACT="native-sources/getting-started-*-runner.jar" \ + --env BP_JVM_VERSION=11 ``` ## Running @@ -26,7 +27,7 @@ docker run --rm --tty --publish 8080:8080 applications/quarkus-native curl -s http://localhost:8080/hello ``` -or +or ```bash curl -s http://localhost:8080/hello/greeting/$(whoami) diff --git a/java/opentelemetry/README.md b/java/opentelemetry/README.md index fe5eea1b..3ffd81cc 100644 --- a/java/opentelemetry/README.md +++ b/java/opentelemetry/README.md @@ -1,12 +1,15 @@ # Java OpenTelemetry Sample Application +See [prerequisites](https://paketo.io/docs/howto/java/#prerequisites) of this sample. + ## Building ```bash pack build applications/opentelemetry \ --buildpack paketo-buildpacks/java \ --buildpack gcr.io/paketo-buildpacks/opentelemetry \ - -e BP_OPENTELEMETRY_ENABLED=true + --env BP_OPENTELEMETRY_ENABLED=true \ + --env BP_JVM_VERSION=11 ``` ## Running diff --git a/java/tools-build/README.md b/java/tools-build/README.md index 6fa9bdcf..afa8a1f3 100644 --- a/java/tools-build/README.md +++ b/java/tools-build/README.md @@ -1,5 +1,7 @@ # Clojure Tools Build Sample Application +See [prerequisites](https://paketo.io/docs/howto/java/#prerequisites) of this sample. + ## Building ```bash diff --git a/java/war/README.md b/java/war/README.md index b8f70aa2..fd573ac4 100644 --- a/java/war/README.md +++ b/java/war/README.md @@ -1,9 +1,11 @@ # Java WAR Sample Application +See [prerequisites](https://paketo.io/docs/howto/java/#prerequisites) of this sample. + ## Building ```bash -pack build applications/war +pack build applications/war --env BP_JVM_VERSION=11 ``` ## Running