Skip to content

Commit

Permalink
Provide BP_JVM_VERSION for all Java samples
Browse files Browse the repository at this point in the history
  • Loading branch information
c0d1ngm0nk3y authored and ForestEckhardt committed Apr 14, 2023
1 parent f5ad2fa commit 2a8467c
Show file tree
Hide file tree
Showing 15 changed files with 52 additions and 20 deletions.
4 changes: 3 additions & 1 deletion java/akka/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 3 additions & 1 deletion java/application-insights/README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -19,7 +21,7 @@ echo "<Instrumentation Key>" > 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
Expand Down
4 changes: 3 additions & 1 deletion java/aspectj/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 3 additions & 1 deletion java/deps/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 3 additions & 1 deletion java/dist-zip/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 5 additions & 3 deletions java/gradle/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 3 additions & 1 deletion java/jar/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 3 additions & 1 deletion java/kotlin/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 3 additions & 1 deletion java/leiningen/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 5 additions & 3 deletions java/maven/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 6 additions & 2 deletions java/native-image/java-native-image-sample/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
5 changes: 3 additions & 2 deletions java/native-image/quarkus-native/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion java/opentelemetry/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions java/tools-build/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Clojure Tools Build Sample Application

See [prerequisites](https://paketo.io/docs/howto/java/#prerequisites) of this sample.

## Building

```bash
Expand Down
4 changes: 3 additions & 1 deletion java/war/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 2a8467c

Please sign in to comment.