diff --git a/.github/workflows/test-pull-request-java-native-image.yml b/.github/workflows/test-pull-request-java-native-image.yml deleted file mode 100644 index d59bf099..00000000 --- a/.github/workflows/test-pull-request-java-native-image.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Test Pull Request (Java Native Image) - -on: - merge_group: - pull_request: - branches: - - main - paths: - - 'java/native-image/**' - -jobs: - smoke: - name: Smoke Tests - runs-on: ubuntu-latest - steps: - - name: Setup Go - uses: actions/setup-go@v4 - with: - go-version: 1.18.x - - - name: Checkout - uses: actions/checkout@v4 - - - name: Cache local Gradle repository - uses: actions/cache@v3 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('java/**/*.gradle*', 'java/**/gradle-wrapper.properties') }} - restore-keys: | - ${{ runner.os }}-gradle- - - - name: Cache local Maven repository - uses: actions/cache@v3 - with: - path: | - ~/.m2/repository - ~/.m2/wrapper - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml', 'java/**/maven-wrapper.properties') }} - restore-keys: | - ${{ runner.os }}-maven- - - - name: Setup Directories - run: | - #!/usr/bin/env bash - set -euo pipefail - - mkdir -p ~/.m2/repository - mkdir -p ~/.m2/repository/wrapper/dists - mkdir -p ~/.gradle/caches - mkdir -p ~/.gradle/wrapper/dists - chmod -R 775 ~/.m2 - chmod -R 775 ~/.gradle - - - name: Test Java Native Image Samples - run: | - ./scripts/smoke.sh --suite java/native-image \ - --builder paketobuildpacks/builder:full \ - --builder paketobuildpacks/builder:base \ - --builder paketobuildpacks/builder:tiny diff --git a/java/native-image/public-static-main/.gitignore b/java/native-image/public-static-main-native-image-maven/.gitignore similarity index 100% rename from java/native-image/public-static-main/.gitignore rename to java/native-image/public-static-main-native-image-maven/.gitignore diff --git a/java/native-image/public-static-main/.mvn/wrapper/MavenWrapperDownloader.java b/java/native-image/public-static-main-native-image-maven/.mvn/wrapper/MavenWrapperDownloader.java similarity index 100% rename from java/native-image/public-static-main/.mvn/wrapper/MavenWrapperDownloader.java rename to java/native-image/public-static-main-native-image-maven/.mvn/wrapper/MavenWrapperDownloader.java diff --git a/java/native-image/java-native-image-sample/.mvn/wrapper/maven-wrapper.jar b/java/native-image/public-static-main-native-image-maven/.mvn/wrapper/maven-wrapper.jar similarity index 100% rename from java/native-image/java-native-image-sample/.mvn/wrapper/maven-wrapper.jar rename to java/native-image/public-static-main-native-image-maven/.mvn/wrapper/maven-wrapper.jar diff --git a/java/native-image/java-native-image-sample/.mvn/wrapper/maven-wrapper.properties b/java/native-image/public-static-main-native-image-maven/.mvn/wrapper/maven-wrapper.properties similarity index 100% rename from java/native-image/java-native-image-sample/.mvn/wrapper/maven-wrapper.properties rename to java/native-image/public-static-main-native-image-maven/.mvn/wrapper/maven-wrapper.properties diff --git a/java/native-image/public-static-main/mvnw b/java/native-image/public-static-main-native-image-maven/mvnw similarity index 100% rename from java/native-image/public-static-main/mvnw rename to java/native-image/public-static-main-native-image-maven/mvnw diff --git a/java/native-image/public-static-main/pom.xml b/java/native-image/public-static-main-native-image-maven/pom.xml similarity index 100% rename from java/native-image/public-static-main/pom.xml rename to java/native-image/public-static-main-native-image-maven/pom.xml diff --git a/java/native-image/java_native_image_public_static_main_test.go b/java/native-image/public-static-main-native-image-maven/smoke_test/java_native_image_public_static_main_test.go similarity index 91% rename from java/native-image/java_native_image_public_static_main_test.go rename to java/native-image/public-static-main-native-image-maven/smoke_test/java_native_image_public_static_main_test.go index 927a1b86..95af6633 100644 --- a/java/native-image/java_native_image_public_static_main_test.go +++ b/java/native-image/public-static-main-native-image-maven/smoke_test/java_native_image_public_static_main_test.go @@ -1,7 +1,9 @@ -package java_test +package native_image_test import ( + "flag" "fmt" + "github.com/paketo-buildpacks/samples/tests" "os" "path/filepath" "testing" @@ -15,6 +17,11 @@ import ( . "github.com/paketo-buildpacks/occam/matchers" ) +var builders tests.BuilderFlags + +func init() { + flag.Var(&builders, "name", "the name a builder to test with") +} func TestJNIPublicStaticMain(t *testing.T) { Expect := NewWithT(t).Expect @@ -69,7 +76,7 @@ func testPublicStaticMainWithBuilder(builder string) func(*testing.T, spec.G, sp context("app uses simple JAR", func() { it("builds successfully", func() { var err error - source, err = occam.Source(filepath.Join(".", "public-static-main")) + source, err = occam.Source(filepath.Join("../")) Expect(err).NotTo(HaveOccurred()) var logs fmt.Stringer diff --git a/java/native-image/public-static-main/src/main/java/io/paketo/App.java b/java/native-image/public-static-main-native-image-maven/src/main/java/io/paketo/App.java similarity index 100% rename from java/native-image/public-static-main/src/main/java/io/paketo/App.java rename to java/native-image/public-static-main-native-image-maven/src/main/java/io/paketo/App.java diff --git a/java/native-image/quarkus-native/.gitignore b/java/native-image/quarkus-native-image-maven/.gitignore similarity index 100% rename from java/native-image/quarkus-native/.gitignore rename to java/native-image/quarkus-native-image-maven/.gitignore diff --git a/java/native-image/quarkus-native/.mvn/wrapper/MavenWrapperDownloader.java b/java/native-image/quarkus-native-image-maven/.mvn/wrapper/MavenWrapperDownloader.java similarity index 100% rename from java/native-image/quarkus-native/.mvn/wrapper/MavenWrapperDownloader.java rename to java/native-image/quarkus-native-image-maven/.mvn/wrapper/MavenWrapperDownloader.java diff --git a/java/native-image/quarkus-native/.mvn/wrapper/maven-wrapper.jar b/java/native-image/quarkus-native-image-maven/.mvn/wrapper/maven-wrapper.jar similarity index 100% rename from java/native-image/quarkus-native/.mvn/wrapper/maven-wrapper.jar rename to java/native-image/quarkus-native-image-maven/.mvn/wrapper/maven-wrapper.jar diff --git a/java/native-image/quarkus-native/.mvn/wrapper/maven-wrapper.properties b/java/native-image/quarkus-native-image-maven/.mvn/wrapper/maven-wrapper.properties similarity index 100% rename from java/native-image/quarkus-native/.mvn/wrapper/maven-wrapper.properties rename to java/native-image/quarkus-native-image-maven/.mvn/wrapper/maven-wrapper.properties diff --git a/java/native-image/quarkus-native/.s2i/environment b/java/native-image/quarkus-native-image-maven/.s2i/environment similarity index 100% rename from java/native-image/quarkus-native/.s2i/environment rename to java/native-image/quarkus-native-image-maven/.s2i/environment diff --git a/java/native-image/quarkus-native/README.md b/java/native-image/quarkus-native-image-maven/README.md similarity index 100% rename from java/native-image/quarkus-native/README.md rename to java/native-image/quarkus-native-image-maven/README.md diff --git a/java/native-image/quarkus-native/mvnw b/java/native-image/quarkus-native-image-maven/mvnw similarity index 100% rename from java/native-image/quarkus-native/mvnw rename to java/native-image/quarkus-native-image-maven/mvnw diff --git a/java/native-image/quarkus-native/mvnw.cmd b/java/native-image/quarkus-native-image-maven/mvnw.cmd similarity index 100% rename from java/native-image/quarkus-native/mvnw.cmd rename to java/native-image/quarkus-native-image-maven/mvnw.cmd diff --git a/java/native-image/quarkus-native/pom.xml b/java/native-image/quarkus-native-image-maven/pom.xml similarity index 100% rename from java/native-image/quarkus-native/pom.xml rename to java/native-image/quarkus-native-image-maven/pom.xml diff --git a/java/native-image/java_native_image_quarkus_native_test.go b/java/native-image/quarkus-native-image-maven/smoke_test/java_native_image_quarkus_native_test.go similarity index 92% rename from java/native-image/java_native_image_quarkus_native_test.go rename to java/native-image/quarkus-native-image-maven/smoke_test/java_native_image_quarkus_native_test.go index ea33eed8..0e39c893 100644 --- a/java/native-image/java_native_image_quarkus_native_test.go +++ b/java/native-image/quarkus-native-image-maven/smoke_test/java_native_image_quarkus_native_test.go @@ -1,7 +1,9 @@ -package java_test +package native_image_test import ( + "flag" "fmt" + "github.com/paketo-buildpacks/samples/tests" "os" "path/filepath" "testing" @@ -15,6 +17,11 @@ import ( . "github.com/paketo-buildpacks/occam/matchers" ) +var builders tests.BuilderFlags + +func init() { + flag.Var(&builders, "name", "the name a builder to test with") +} func TestJNIQuarkus(t *testing.T) { Expect := NewWithT(t).Expect @@ -69,7 +76,7 @@ func testQuarkusWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { context("uses simple Quarkus app", func() { it("builds successfully", func() { var err error - source, err = occam.Source(filepath.Join(".", "quarkus-native")) + source, err = occam.Source(filepath.Join("../")) Expect(err).NotTo(HaveOccurred()) var logs fmt.Stringer diff --git a/java/native-image/quarkus-native/src/main/java/org/acme/getting/started/GreetingResource.java b/java/native-image/quarkus-native-image-maven/src/main/java/org/acme/getting/started/GreetingResource.java similarity index 100% rename from java/native-image/quarkus-native/src/main/java/org/acme/getting/started/GreetingResource.java rename to java/native-image/quarkus-native-image-maven/src/main/java/org/acme/getting/started/GreetingResource.java diff --git a/java/native-image/quarkus-native/src/main/java/org/acme/getting/started/GreetingService.java b/java/native-image/quarkus-native-image-maven/src/main/java/org/acme/getting/started/GreetingService.java similarity index 100% rename from java/native-image/quarkus-native/src/main/java/org/acme/getting/started/GreetingService.java rename to java/native-image/quarkus-native-image-maven/src/main/java/org/acme/getting/started/GreetingService.java diff --git a/java/native-image/quarkus-native/src/main/resources/META-INF/resources/index.html b/java/native-image/quarkus-native-image-maven/src/main/resources/META-INF/resources/index.html similarity index 100% rename from java/native-image/quarkus-native/src/main/resources/META-INF/resources/index.html rename to java/native-image/quarkus-native-image-maven/src/main/resources/META-INF/resources/index.html diff --git a/java/native-image/quarkus-native/src/main/resources/application.properties b/java/native-image/quarkus-native-image-maven/src/main/resources/application.properties similarity index 100% rename from java/native-image/quarkus-native/src/main/resources/application.properties rename to java/native-image/quarkus-native-image-maven/src/main/resources/application.properties diff --git a/java/native-image/quarkus-native/src/test/java/org/acme/getting/started/GreetingResourceTest.java b/java/native-image/quarkus-native-image-maven/src/test/java/org/acme/getting/started/GreetingResourceTest.java similarity index 100% rename from java/native-image/quarkus-native/src/test/java/org/acme/getting/started/GreetingResourceTest.java rename to java/native-image/quarkus-native-image-maven/src/test/java/org/acme/getting/started/GreetingResourceTest.java diff --git a/java/native-image/quarkus-native/src/test/java/org/acme/getting/started/NativeGreetingResourceIT.java b/java/native-image/quarkus-native-image-maven/src/test/java/org/acme/getting/started/NativeGreetingResourceIT.java similarity index 100% rename from java/native-image/quarkus-native/src/test/java/org/acme/getting/started/NativeGreetingResourceIT.java rename to java/native-image/quarkus-native-image-maven/src/test/java/org/acme/getting/started/NativeGreetingResourceIT.java diff --git a/java/native-image/java-native-image-sample-gradle/.gitignore b/java/native-image/spring-boot-native-image-gradle/.gitignore similarity index 100% rename from java/native-image/java-native-image-sample-gradle/.gitignore rename to java/native-image/spring-boot-native-image-gradle/.gitignore diff --git a/java/native-image/java-native-image-sample-gradle/README.md b/java/native-image/spring-boot-native-image-gradle/README.md similarity index 100% rename from java/native-image/java-native-image-sample-gradle/README.md rename to java/native-image/spring-boot-native-image-gradle/README.md diff --git a/java/native-image/java-native-image-sample-gradle/build.gradle b/java/native-image/spring-boot-native-image-gradle/build.gradle similarity index 100% rename from java/native-image/java-native-image-sample-gradle/build.gradle rename to java/native-image/spring-boot-native-image-gradle/build.gradle diff --git a/java/native-image/java-native-image-sample-gradle/gradle/wrapper/gradle-wrapper.jar b/java/native-image/spring-boot-native-image-gradle/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from java/native-image/java-native-image-sample-gradle/gradle/wrapper/gradle-wrapper.jar rename to java/native-image/spring-boot-native-image-gradle/gradle/wrapper/gradle-wrapper.jar diff --git a/java/native-image/java-native-image-sample-gradle/gradle/wrapper/gradle-wrapper.properties b/java/native-image/spring-boot-native-image-gradle/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from java/native-image/java-native-image-sample-gradle/gradle/wrapper/gradle-wrapper.properties rename to java/native-image/spring-boot-native-image-gradle/gradle/wrapper/gradle-wrapper.properties diff --git a/java/native-image/java-native-image-sample-gradle/gradlew b/java/native-image/spring-boot-native-image-gradle/gradlew similarity index 100% rename from java/native-image/java-native-image-sample-gradle/gradlew rename to java/native-image/spring-boot-native-image-gradle/gradlew diff --git a/java/native-image/java-native-image-sample-gradle/gradlew.bat b/java/native-image/spring-boot-native-image-gradle/gradlew.bat similarity index 100% rename from java/native-image/java-native-image-sample-gradle/gradlew.bat rename to java/native-image/spring-boot-native-image-gradle/gradlew.bat diff --git a/java/native-image/java-native-image-sample-gradle/settings.gradle b/java/native-image/spring-boot-native-image-gradle/settings.gradle similarity index 100% rename from java/native-image/java-native-image-sample-gradle/settings.gradle rename to java/native-image/spring-boot-native-image-gradle/settings.gradle diff --git a/java/native-image/java_native_image_gradle_test.go b/java/native-image/spring-boot-native-image-gradle/smoke_test/java_native_image_gradle_test.go similarity index 96% rename from java/native-image/java_native_image_gradle_test.go rename to java/native-image/spring-boot-native-image-gradle/smoke_test/java_native_image_gradle_test.go index 396c8d1f..a8989abc 100644 --- a/java/native-image/java_native_image_gradle_test.go +++ b/java/native-image/spring-boot-native-image-gradle/smoke_test/java_native_image_gradle_test.go @@ -1,4 +1,4 @@ -package java_test +package native_image_test import ( "flag" @@ -77,7 +77,7 @@ func testGradleWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { context("uses Gradle based Spring Boot app", func() { it("builds successfully", func() { var err error - source, err = occam.Source(filepath.Join(".", "java-native-image-sample-gradle")) + source, err = occam.Source(filepath.Join("../")) Expect(err).NotTo(HaveOccurred()) var logs fmt.Stringer diff --git a/java/native-image/java-native-image-sample-gradle/src/main/java/io/paketo/demo/DemoApplication.java b/java/native-image/spring-boot-native-image-gradle/src/main/java/io/paketo/demo/DemoApplication.java similarity index 100% rename from java/native-image/java-native-image-sample-gradle/src/main/java/io/paketo/demo/DemoApplication.java rename to java/native-image/spring-boot-native-image-gradle/src/main/java/io/paketo/demo/DemoApplication.java diff --git a/java/native-image/java-native-image-sample-gradle/src/main/resources/application.properties b/java/native-image/spring-boot-native-image-gradle/src/main/resources/application.properties similarity index 100% rename from java/native-image/java-native-image-sample-gradle/src/main/resources/application.properties rename to java/native-image/spring-boot-native-image-gradle/src/main/resources/application.properties diff --git a/java/native-image/java-native-image-sample-gradle/src/test/java/io/paketo/demo/DemoApplicationTests.java b/java/native-image/spring-boot-native-image-gradle/src/test/java/io/paketo/demo/DemoApplicationTests.java similarity index 100% rename from java/native-image/java-native-image-sample-gradle/src/test/java/io/paketo/demo/DemoApplicationTests.java rename to java/native-image/spring-boot-native-image-gradle/src/test/java/io/paketo/demo/DemoApplicationTests.java diff --git a/java/native-image/java-native-image-sample/.gitignore b/java/native-image/spring-boot-native-image-maven/.gitignore similarity index 100% rename from java/native-image/java-native-image-sample/.gitignore rename to java/native-image/spring-boot-native-image-maven/.gitignore diff --git a/java/native-image/java-native-image-sample/.mvn/wrapper/MavenWrapperDownloader.java b/java/native-image/spring-boot-native-image-maven/.mvn/wrapper/MavenWrapperDownloader.java similarity index 100% rename from java/native-image/java-native-image-sample/.mvn/wrapper/MavenWrapperDownloader.java rename to java/native-image/spring-boot-native-image-maven/.mvn/wrapper/MavenWrapperDownloader.java diff --git a/java/native-image/public-static-main/.mvn/wrapper/maven-wrapper.jar b/java/native-image/spring-boot-native-image-maven/.mvn/wrapper/maven-wrapper.jar similarity index 100% rename from java/native-image/public-static-main/.mvn/wrapper/maven-wrapper.jar rename to java/native-image/spring-boot-native-image-maven/.mvn/wrapper/maven-wrapper.jar diff --git a/java/native-image/public-static-main/.mvn/wrapper/maven-wrapper.properties b/java/native-image/spring-boot-native-image-maven/.mvn/wrapper/maven-wrapper.properties similarity index 100% rename from java/native-image/public-static-main/.mvn/wrapper/maven-wrapper.properties rename to java/native-image/spring-boot-native-image-maven/.mvn/wrapper/maven-wrapper.properties diff --git a/java/native-image/java-native-image-sample/README.md b/java/native-image/spring-boot-native-image-maven/README.md similarity index 100% rename from java/native-image/java-native-image-sample/README.md rename to java/native-image/spring-boot-native-image-maven/README.md diff --git a/java/native-image/java-native-image-sample/mvnw b/java/native-image/spring-boot-native-image-maven/mvnw similarity index 100% rename from java/native-image/java-native-image-sample/mvnw rename to java/native-image/spring-boot-native-image-maven/mvnw diff --git a/java/native-image/java-native-image-sample/mvnw.cmd b/java/native-image/spring-boot-native-image-maven/mvnw.cmd similarity index 100% rename from java/native-image/java-native-image-sample/mvnw.cmd rename to java/native-image/spring-boot-native-image-maven/mvnw.cmd diff --git a/java/native-image/java-native-image-sample/pom.xml b/java/native-image/spring-boot-native-image-maven/pom.xml similarity index 100% rename from java/native-image/java-native-image-sample/pom.xml rename to java/native-image/spring-boot-native-image-maven/pom.xml diff --git a/java/native-image/java_native_image_maven_test.go b/java/native-image/spring-boot-native-image-maven/smoke_test/java_native_image_maven_test.go similarity index 92% rename from java/native-image/java_native_image_maven_test.go rename to java/native-image/spring-boot-native-image-maven/smoke_test/java_native_image_maven_test.go index 8f3a80d8..0a8dc732 100644 --- a/java/native-image/java_native_image_maven_test.go +++ b/java/native-image/spring-boot-native-image-maven/smoke_test/java_native_image_maven_test.go @@ -1,7 +1,9 @@ -package java_test +package native_image_test import ( + "flag" "fmt" + "github.com/paketo-buildpacks/samples/tests" "os" "path/filepath" "testing" @@ -15,6 +17,11 @@ import ( . "github.com/paketo-buildpacks/occam/matchers" ) +var builders tests.BuilderFlags + +func init() { + flag.Var(&builders, "name", "the name a builder to test with") +} func TestJNIMaven(t *testing.T) { Expect := NewWithT(t).Expect @@ -69,7 +76,7 @@ func testMavenWithBuilder(builder string) func(*testing.T, spec.G, spec.S) { context("uses Spring Boot app Maven", func() { it("builds successfully", func() { var err error - source, err = occam.Source(filepath.Join(".", "java-native-image-sample")) + source, err = occam.Source(filepath.Join("../")) Expect(err).NotTo(HaveOccurred()) var logs fmt.Stringer diff --git a/java/native-image/java-native-image-sample/src/main/java/io/paketo/demo/DemoApplication.java b/java/native-image/spring-boot-native-image-maven/src/main/java/io/paketo/demo/DemoApplication.java similarity index 100% rename from java/native-image/java-native-image-sample/src/main/java/io/paketo/demo/DemoApplication.java rename to java/native-image/spring-boot-native-image-maven/src/main/java/io/paketo/demo/DemoApplication.java diff --git a/java/native-image/java-native-image-sample/src/main/resources/application.properties b/java/native-image/spring-boot-native-image-maven/src/main/resources/application.properties similarity index 100% rename from java/native-image/java-native-image-sample/src/main/resources/application.properties rename to java/native-image/spring-boot-native-image-maven/src/main/resources/application.properties diff --git a/java/native-image/java-native-image-sample/src/test/java/io/paketo/demo/DemoApplicationTests.java b/java/native-image/spring-boot-native-image-maven/src/test/java/io/paketo/demo/DemoApplicationTests.java similarity index 100% rename from java/native-image/java-native-image-sample/src/test/java/io/paketo/demo/DemoApplicationTests.java rename to java/native-image/spring-boot-native-image-maven/src/test/java/io/paketo/demo/DemoApplicationTests.java