diff --git a/it/src/main/java/org/eclipse/jkube/integrationtests/docker/DockerUtils.java b/it/src/main/java/org/eclipse/jkube/integrationtests/docker/DockerUtils.java index ae16e8a9..af9dfe50 100644 --- a/it/src/main/java/org/eclipse/jkube/integrationtests/docker/DockerUtils.java +++ b/it/src/main/java/org/eclipse/jkube/integrationtests/docker/DockerUtils.java @@ -65,6 +65,11 @@ public static void pull(String image) throws IOException, InterruptedException { } } + public static List getImageHistory(String imageName) throws IOException, InterruptedException { + final CliResult result = CliUtils.runCommand(String.format("docker history %s", imageName)); + return Arrays.asList(result.getOutput().replace("\r", "").split("\n")); + } + public static void loadTar(File dockerBuildTar) throws IOException, InterruptedException { final CliResult result = CliUtils.runCommand(String.format( "docker load -i %s", dockerBuildTar.getAbsolutePath() diff --git a/it/src/test/java/org/eclipse/jkube/integrationtests/springboot/complete/CompleteK8sITCase.java b/it/src/test/java/org/eclipse/jkube/integrationtests/springboot/complete/CompleteK8sITCase.java index d4abdd85..b5180495 100644 --- a/it/src/test/java/org/eclipse/jkube/integrationtests/springboot/complete/CompleteK8sITCase.java +++ b/it/src/test/java/org/eclipse/jkube/integrationtests/springboot/complete/CompleteK8sITCase.java @@ -35,6 +35,7 @@ import static org.eclipse.jkube.integrationtests.assertions.JKubeAssertions.assertJKube; import static org.eclipse.jkube.integrationtests.assertions.KubernetesListAssertion.assertListResource; import static org.eclipse.jkube.integrationtests.assertions.YamlAssertion.yaml; +import static org.eclipse.jkube.integrationtests.docker.DockerUtils.getImageHistory; import static org.eclipse.jkube.integrationtests.docker.DockerUtils.listImageFiles; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.allOf; @@ -66,14 +67,22 @@ void k8sBuild() throws Exception { // Then assertInvocation(invocationResult); assertImageWasRecentlyBuilt("integration-tests", getApplication()); - final File dockerDirectory = new File( - String.format("../%s/target/docker/integration-tests/spring-boot-complete/", getProject())); final List imageFiles = listImageFiles(String.format("%s/%s", "integration-tests", getApplication()), "/deployments"); assertThat(imageFiles, not(hasItem("/deployments/assembly-test"))); assertThat(imageFiles, not(hasItem("/deployments/static"))); assertThat(imageFiles, hasItem("/deployments/will-be-included-if-no-assemblies-defined.txt")); - assertThat(imageFiles, hasItem("/deployments/spring-boot-complete-0.0.0-SNAPSHOT.jar")); + assertThat(imageFiles, hasItem("/deployments/BOOT-INF")); + assertThat(imageFiles, hasItem("/deployments/BOOT-INF/lib")); + assertThat(imageFiles, hasItem("/deployments/BOOT-INF/classes")); + assertThat(imageFiles, hasItem("/deployments/BOOT-INF/classpath.idx")); + assertThat(imageFiles, hasItem("/deployments/BOOT-INF/layers.idx")); + assertThat(imageFiles, hasItem("/deployments/org/springframework/boot/loader/JarLauncher.class")); + final List imageHistory = getImageHistory(String.format("%s/%s", "integration-tests", getApplication())); + long dirCopyLayers = imageHistory.stream() + .filter(l -> l.contains("COPY dir:")) + .count(); + assertThat(dirCopyLayers, equalTo(4L)); } @Test diff --git a/it/src/test/java/org/eclipse/jkube/integrationtests/springboot/zeroconfig/ZeroConfigK8sGradleITCase.java b/it/src/test/java/org/eclipse/jkube/integrationtests/springboot/zeroconfig/ZeroConfigK8sGradleITCase.java index ad77402a..bfa57d94 100644 --- a/it/src/test/java/org/eclipse/jkube/integrationtests/springboot/zeroconfig/ZeroConfigK8sGradleITCase.java +++ b/it/src/test/java/org/eclipse/jkube/integrationtests/springboot/zeroconfig/ZeroConfigK8sGradleITCase.java @@ -27,6 +27,8 @@ import org.junit.jupiter.api.TestMethodOrder; import org.junit.jupiter.api.parallel.ResourceLock; +import java.util.List; + import static org.eclipse.jkube.integrationtests.Locks.CLUSTER_RESOURCE_INTENSIVE; import static org.eclipse.jkube.integrationtests.Tags.KUBERNETES; import static org.eclipse.jkube.integrationtests.assertions.DeploymentAssertion.awaitDeployment; @@ -36,6 +38,8 @@ import static org.eclipse.jkube.integrationtests.assertions.PodAssertion.awaitPod; import static org.eclipse.jkube.integrationtests.assertions.ServiceAssertion.awaitService; import static org.eclipse.jkube.integrationtests.assertions.YamlAssertion.yaml; +import static org.eclipse.jkube.integrationtests.docker.DockerUtils.getImageHistory; +import static org.eclipse.jkube.integrationtests.docker.DockerUtils.listImageFiles; import static org.eclipse.jkube.integrationtests.springboot.zeroconfig.ZeroConfig.GRADLE_APPLICATION; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.aMapWithSize; @@ -44,6 +48,7 @@ import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasEntry; +import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.Matchers.hasItems; import static org.hamcrest.Matchers.hasProperty; import static org.hamcrest.Matchers.hasSize; @@ -89,6 +94,19 @@ void k8sBuild() throws Exception { gradle.tasks("k8sBuild").build(); // Then assertImageWasRecentlyBuilt("gradle", getApplication()); + final List imageFiles = listImageFiles(String.format("%s/%s", "gradle", getApplication()), + "/deployments"); + assertThat(imageFiles, hasItem("/deployments/BOOT-INF")); + assertThat(imageFiles, hasItem("/deployments/BOOT-INF/lib")); + assertThat(imageFiles, hasItem("/deployments/BOOT-INF/classes")); + assertThat(imageFiles, hasItem("/deployments/BOOT-INF/classpath.idx")); + assertThat(imageFiles, hasItem("/deployments/BOOT-INF/layers.idx")); + assertThat(imageFiles, hasItem("/deployments/org/springframework/boot/loader/JarLauncher.class")); + final List imageHistory = getImageHistory(String.format("%s/%s", "gradle", getApplication())); + long dirCopyLayers = imageHistory.stream() + .filter(l -> l.contains("COPY dir:")) + .count(); + assertThat(dirCopyLayers, equalTo(3L)); } @Test diff --git a/it/src/test/java/org/eclipse/jkube/integrationtests/springboot/zeroconfig/ZeroConfigK8sITCase.java b/it/src/test/java/org/eclipse/jkube/integrationtests/springboot/zeroconfig/ZeroConfigK8sITCase.java index 14d12ef5..91f43502 100644 --- a/it/src/test/java/org/eclipse/jkube/integrationtests/springboot/zeroconfig/ZeroConfigK8sITCase.java +++ b/it/src/test/java/org/eclipse/jkube/integrationtests/springboot/zeroconfig/ZeroConfigK8sITCase.java @@ -29,6 +29,7 @@ import org.junit.jupiter.api.parallel.ResourceLock; import java.io.File; +import java.util.List; import java.util.Properties; import static org.eclipse.jkube.integrationtests.Locks.CLUSTER_RESOURCE_INTENSIVE; @@ -39,12 +40,15 @@ import static org.eclipse.jkube.integrationtests.assertions.JKubeAssertions.assertJKube; import static org.eclipse.jkube.integrationtests.assertions.KubernetesListAssertion.assertListResource; import static org.eclipse.jkube.integrationtests.assertions.YamlAssertion.yaml; +import static org.eclipse.jkube.integrationtests.docker.DockerUtils.getImageHistory; +import static org.eclipse.jkube.integrationtests.docker.DockerUtils.listImageFiles; import static org.eclipse.jkube.integrationtests.springboot.zeroconfig.ZeroConfig.MAVEN_APPLICATION; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.anEmptyMap; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.Matchers.hasItems; import static org.hamcrest.Matchers.hasProperty; import static org.hamcrest.Matchers.hasSize; @@ -68,13 +72,25 @@ public String getProject() { @Test @Order(1) - @DisplayName("k8s:build, should create image") + @DisplayName("k8s:build, should create layered jar image") void k8sBuild() throws Exception { // When final InvocationResult invocationResult = maven("k8s:build"); // Then assertInvocation(invocationResult); assertImageWasRecentlyBuilt("integration-tests", "spring-boot-zero-config"); + final List imageFiles = listImageFiles("integration-tests/spring-boot-zero-config", "/deployments"); + assertThat(imageFiles, hasItem("/deployments/BOOT-INF")); + assertThat(imageFiles, hasItem("/deployments/BOOT-INF/lib")); + assertThat(imageFiles, hasItem("/deployments/BOOT-INF/classes")); + assertThat(imageFiles, hasItem("/deployments/BOOT-INF/classpath.idx")); + assertThat(imageFiles, hasItem("/deployments/BOOT-INF/layers.idx")); + assertThat(imageFiles, hasItem("/deployments/org/springframework/boot/loader/JarLauncher.class")); + final List imageHistory = getImageHistory(String.format("%s/%s", "integration-tests", getApplication())); + long dirCopyLayers = imageHistory.stream() + .filter(l -> l.contains("COPY dir:")) + .count(); + assertThat(dirCopyLayers, equalTo(3L)); } @Test diff --git a/it/src/test/java/org/eclipse/jkube/integrationtests/springboot/zeroconfigfatjar/ZeroConfigFatJar.java b/it/src/test/java/org/eclipse/jkube/integrationtests/springboot/zeroconfigfatjar/ZeroConfigFatJar.java new file mode 100644 index 00000000..7a80c149 --- /dev/null +++ b/it/src/test/java/org/eclipse/jkube/integrationtests/springboot/zeroconfigfatjar/ZeroConfigFatJar.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2019 Red Hat, Inc. + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at: + * + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Red Hat, Inc. - initial API and implementation + */ +package org.eclipse.jkube.integrationtests.springboot.zeroconfigfatjar; + +import io.fabric8.junit.jupiter.api.KubernetesTest; +import io.fabric8.kubernetes.api.model.Pod; +import io.fabric8.kubernetes.client.KubernetesClient; +import org.eclipse.jkube.integrationtests.JKubeCase; +import org.eclipse.jkube.integrationtests.maven.MavenCase; + +import static org.eclipse.jkube.integrationtests.assertions.PodAssertion.awaitPod; +import static org.eclipse.jkube.integrationtests.assertions.ServiceAssertion.awaitService; +import static org.hamcrest.Matchers.hasSize; + +@KubernetesTest(createEphemeralNamespace = false) +public class ZeroConfigFatJar implements JKubeCase, MavenCase { + private static final String PROJECT_ZERO_CONFIG_FATJAR = "projects-to-be-tested/maven/spring/zero-config-fatjar"; + + private static KubernetesClient kubernetesClient; + + @Override + public KubernetesClient getKubernetesClient() { + return kubernetesClient; + } + + @Override + public String getProject() { + return PROJECT_ZERO_CONFIG_FATJAR; + } + + @Override + public String getApplication() { + return "spring-boot-zero-config-fatjar"; + } + + final Pod assertThatShouldApplyResources() throws Exception { + final Pod pod = awaitPod(this) + .logContains("Started ZeroConfigFatJarApplication in", 40) + .getKubernetesResource(); + awaitService(this, pod.getMetadata().getNamespace()) + .assertPorts(hasSize(1)) + .assertPort("http", 8080, false); + return pod; + } +} diff --git a/it/src/test/java/org/eclipse/jkube/integrationtests/springboot/zeroconfigfatjar/ZeroConfigFatJarK8sITCase.java b/it/src/test/java/org/eclipse/jkube/integrationtests/springboot/zeroconfigfatjar/ZeroConfigFatJarK8sITCase.java new file mode 100644 index 00000000..ec88f8e9 --- /dev/null +++ b/it/src/test/java/org/eclipse/jkube/integrationtests/springboot/zeroconfigfatjar/ZeroConfigFatJarK8sITCase.java @@ -0,0 +1,139 @@ +/** + * Copyright (c) 2019 Red Hat, Inc. + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at: + * + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Red Hat, Inc. - initial API and implementation + */ +package org.eclipse.jkube.integrationtests.springboot.zeroconfigfatjar; + +import io.fabric8.kubernetes.api.model.Pod; +import org.apache.maven.shared.invoker.InvocationResult; +import org.eclipse.jkube.integrationtests.maven.MavenInvocationResult; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; +import org.junit.jupiter.api.parallel.ResourceLock; + +import java.io.File; +import java.util.List; + +import static org.eclipse.jkube.integrationtests.Locks.CLUSTER_RESOURCE_INTENSIVE; +import static org.eclipse.jkube.integrationtests.Tags.KUBERNETES; +import static org.eclipse.jkube.integrationtests.assertions.DeploymentAssertion.awaitDeployment; +import static org.eclipse.jkube.integrationtests.assertions.DockerAssertion.assertImageWasRecentlyBuilt; +import static org.eclipse.jkube.integrationtests.assertions.InvocationResultAssertion.assertInvocation; +import static org.eclipse.jkube.integrationtests.assertions.JKubeAssertions.assertJKube; +import static org.eclipse.jkube.integrationtests.assertions.KubernetesListAssertion.assertListResource; +import static org.eclipse.jkube.integrationtests.assertions.YamlAssertion.yaml; +import static org.eclipse.jkube.integrationtests.docker.DockerUtils.getImageHistory; +import static org.eclipse.jkube.integrationtests.docker.DockerUtils.listImageFiles; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.allOf; +import static org.hamcrest.Matchers.anEmptyMap; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.hasItem; +import static org.hamcrest.Matchers.hasItems; +import static org.hamcrest.Matchers.hasProperty; +import static org.hamcrest.Matchers.hasSize; +import static org.hamcrest.Matchers.not; +import static org.hamcrest.Matchers.stringContainsInOrder; +import static org.junit.jupiter.api.parallel.ResourceAccessMode.READ_WRITE; + +@Tag(KUBERNETES) +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) +class ZeroConfigFatJarK8sITCase extends ZeroConfigFatJar { + @Test + @Order(1) + @DisplayName("k8s:build, should create fat jar image") + void k8sBuild() throws Exception { + // When + final InvocationResult invocationResult = maven("k8s:build"); + // Then + assertInvocation(invocationResult); + assertImageWasRecentlyBuilt("integration-tests", "spring-boot-zero-config-fatjar"); + final List imageFiles = listImageFiles("integration-tests/spring-boot-zero-config-fatjar", "/deployments"); + assertThat(imageFiles, hasItem("/deployments/data")); + assertThat(imageFiles, hasItem("/deployments/spring-boot-zero-config-fatjar-0.0.0-SNAPSHOT.jar")); + final List imageHistory = getImageHistory(String.format("%s/%s", "integration-tests", getApplication())); + long dirCopyLayers = imageHistory.stream() + .filter(l -> l.contains("COPY dir:")) + .count(); + assertThat(dirCopyLayers, equalTo(1L)); + } + + @Test + @Order(2) + @DisplayName("k8s:resource, should create manifests") + void k8sResource() throws Exception { + // When + final InvocationResult invocationResult = maven("k8s:resource"); + // Then + assertInvocation(invocationResult); + final File metaInfDirectory = new File( + String.format("../%s/target/classes/META-INF", getProject())); + assertThat(metaInfDirectory.exists(), equalTo(true)); + assertListResource(new File(metaInfDirectory, "jkube/kubernetes.yml")); + assertThat(new File(metaInfDirectory, "jkube/kubernetes/spring-boot-zero-config-fatjar-deployment.yml"), yaml(not(anEmptyMap()))); + assertThat(new File(metaInfDirectory, "jkube/kubernetes/spring-boot-zero-config-fatjar-service.yml"), yaml(not(anEmptyMap()))); + } + + @Test + @Order(3) + @ResourceLock(value = CLUSTER_RESOURCE_INTENSIVE, mode = READ_WRITE) + @DisplayName("k8s:apply, should deploy pod and service") + @SuppressWarnings("unchecked") + void k8sApply() throws Exception { + // When + final InvocationResult invocationResult = maven("k8s:apply"); + // Then + assertInvocation(invocationResult); + final Pod pod = assertThatShouldApplyResources(); + awaitDeployment(this, pod.getMetadata().getNamespace()) + .assertReplicas(equalTo(1)) + .assertContainers(hasSize(1)) + .assertContainers(hasItems(allOf( + hasProperty("image", equalTo("integration-tests/spring-boot-zero-config-fatjar:latest")), + hasProperty("name", equalTo("spring-boot")), + hasProperty("ports", hasSize(3)), + hasProperty("ports", hasItems(allOf( + hasProperty("name", equalTo("http")), + hasProperty("containerPort", equalTo(8080)) + ))) + ))); + } + + @Test + @Order(4) + @DisplayName("k8s:log, should retrieve log") + void k8sLog() throws Exception { + // When + final MavenInvocationResult invocationResult = maven("k8s:log", properties("jkube.log.follow", "false")); + // Then + assertInvocation(invocationResult); + assertThat(invocationResult.getStdOut(), + stringContainsInOrder("Tomcat started on port(s): 8080", "Started ZeroConfigFatJarApplication in", "seconds")); + } + + @Test + @Order(5) + @DisplayName("k8s:undeploy, should delete all applied resources") + void k8sUndeploy() throws Exception { + // When + final InvocationResult invocationResult = maven("k8s:undeploy"); + // Then + assertInvocation(invocationResult); + assertJKube(this) + .assertThatShouldDeleteAllAppliedResources() + .assertDeploymentDeleted(); + } +} diff --git a/pom.xml b/pom.xml index e7c9f72b..2bf180db 100644 --- a/pom.xml +++ b/pom.xml @@ -51,6 +51,7 @@ 3.2.3.Final 2.0.7 2.7.5 + 2.3.9.RELEASE 2.7.0.Final 4.4.4 1.0.28 @@ -128,21 +129,6 @@ slf4j-simple ${slf4j.version} - - org.springframework.boot - spring-boot-starter - ${spring-boot.version} - - - org.springframework.boot - spring-boot-starter-web - ${spring-boot.version} - - - org.springframework.boot - spring-boot-devtools - ${spring-boot.version} - @@ -209,11 +195,6 @@ maven-failsafe-plugin ${apache.maven-failsafe-plugin.version} - - org.springframework.boot - spring-boot-maven-plugin - ${spring-boot.version} - org.eclipse.jkube kubernetes-maven-plugin @@ -393,6 +374,7 @@ projects-to-be-tested/maven/spring/multi-profile projects-to-be-tested/maven/spring/watch projects-to-be-tested/maven/spring/zero-config + projects-to-be-tested/maven/spring/zero-config-fatjar diff --git a/projects-to-be-tested/maven/dockerfile/simple/pom.xml b/projects-to-be-tested/maven/dockerfile/simple/pom.xml index 346488a7..fe88fd07 100644 --- a/projects-to-be-tested/maven/dockerfile/simple/pom.xml +++ b/projects-to-be-tested/maven/dockerfile/simple/pom.xml @@ -42,11 +42,13 @@ org.springframework.boot spring-boot-starter + ${spring-boot.version} org.springframework.boot spring-boot-starter-web compile + ${spring-boot.version} @@ -55,6 +57,7 @@ org.springframework.boot spring-boot-maven-plugin + ${spring-boot.version} diff --git a/projects-to-be-tested/maven/spring/complete/pom.xml b/projects-to-be-tested/maven/spring/complete/pom.xml index 0ceb1a4f..3b4bc74a 100644 --- a/projects-to-be-tested/maven/spring/complete/pom.xml +++ b/projects-to-be-tested/maven/spring/complete/pom.xml @@ -40,10 +40,12 @@ org.springframework.boot spring-boot-starter + ${spring-boot.version} org.springframework.boot spring-boot-starter-web + ${spring-boot.version} compile @@ -53,6 +55,7 @@ org.springframework.boot spring-boot-maven-plugin + ${spring-boot.version} diff --git a/projects-to-be-tested/maven/spring/complete/src/main/jkube/k8s/deployment.yml b/projects-to-be-tested/maven/spring/complete/src/main/jkube/k8s/deployment.yml index 144f1d56..29bfeabb 100644 --- a/projects-to-be-tested/maven/spring/complete/src/main/jkube/k8s/deployment.yml +++ b/projects-to-be-tested/maven/spring/complete/src/main/jkube/k8s/deployment.yml @@ -23,7 +23,7 @@ spec: revision: '0.1.0' containers: - command: ["java"] - args: ["-jar", "/deployments/spring-boot-complete-0.0.0-SNAPSHOT.jar"] + args: ["org.springframework.boot.loader.JarLauncher"] volumeMounts: - name: jkube - mountPath: /app/ \ No newline at end of file + mountPath: /app/ diff --git a/projects-to-be-tested/maven/spring/crd/pom.xml b/projects-to-be-tested/maven/spring/crd/pom.xml index 67a22a94..89554664 100644 --- a/projects-to-be-tested/maven/spring/crd/pom.xml +++ b/projects-to-be-tested/maven/spring/crd/pom.xml @@ -41,10 +41,12 @@ org.springframework.boot spring-boot-starter + ${spring-boot.version} org.springframework.boot spring-boot-starter-web + ${spring-boot.version} io.fabric8 @@ -58,6 +60,7 @@ org.springframework.boot spring-boot-maven-plugin + ${spring-boot.version} diff --git a/projects-to-be-tested/maven/spring/helm-config/pom.xml b/projects-to-be-tested/maven/spring/helm-config/pom.xml index 8e947681..f554afa0 100644 --- a/projects-to-be-tested/maven/spring/helm-config/pom.xml +++ b/projects-to-be-tested/maven/spring/helm-config/pom.xml @@ -36,11 +36,13 @@ org.springframework.boot spring-boot-starter + ${spring-boot.version} org.springframework.boot spring-boot-starter-web compile + ${spring-boot.version} @@ -49,6 +51,7 @@ org.springframework.boot spring-boot-maven-plugin + ${spring-boot.version} diff --git a/projects-to-be-tested/maven/spring/multi-profile/pom.xml b/projects-to-be-tested/maven/spring/multi-profile/pom.xml index a23213a1..117bd457 100644 --- a/projects-to-be-tested/maven/spring/multi-profile/pom.xml +++ b/projects-to-be-tested/maven/spring/multi-profile/pom.xml @@ -36,10 +36,12 @@ org.springframework.boot spring-boot-starter + ${spring-boot.version} org.springframework.boot spring-boot-starter-web + ${spring-boot.version} compile @@ -49,6 +51,7 @@ org.springframework.boot spring-boot-maven-plugin + ${spring-boot.version} diff --git a/projects-to-be-tested/maven/spring/watch/pom.xml b/projects-to-be-tested/maven/spring/watch/pom.xml index 4c4abdf0..0c6ec7ed 100755 --- a/projects-to-be-tested/maven/spring/watch/pom.xml +++ b/projects-to-be-tested/maven/spring/watch/pom.xml @@ -40,11 +40,13 @@ org.springframework.boot spring-boot-starter-web + ${spring-boot.version} org.springframework.boot spring-boot-devtools + ${spring-boot.version} runtime @@ -54,6 +56,7 @@ org.springframework.boot spring-boot-maven-plugin + ${spring-boot.version} diff --git a/projects-to-be-tested/maven/spring/zero-config-fatjar/pom.xml b/projects-to-be-tested/maven/spring/zero-config-fatjar/pom.xml new file mode 100644 index 00000000..fd8ce1a0 --- /dev/null +++ b/projects-to-be-tested/maven/spring/zero-config-fatjar/pom.xml @@ -0,0 +1,74 @@ + + + + 4.0.0 + + + org.eclipse.jkube.integration-tests + jkube-integration-tests-project + ${revision} + ../../../../pom.xml + + + spring-boot-zero-config-fatjar + ${global.name} :: Spring Boot :: Zero Config with Legacy Fat jar + + Spring Boot with Zero Config project with legacy fat jar + + + + + org.springframework.boot + spring-boot-starter + ${spring-boot.fat-jar.version} + + + org.springframework.boot + spring-boot-starter-web + ${spring-boot.fat-jar.version} + compile + + + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.fat-jar.version} + + + + repackage + + + + + + org.eclipse.jkube + kubernetes-maven-plugin + + + org.eclipse.jkube + openshift-maven-plugin + + + + + diff --git a/projects-to-be-tested/maven/spring/zero-config-fatjar/src/main/java/org/eclipse/jkube/integrationtests/springboot/zeroconfigfatjar/ZeroConfigFatJarApplication.java b/projects-to-be-tested/maven/spring/zero-config-fatjar/src/main/java/org/eclipse/jkube/integrationtests/springboot/zeroconfigfatjar/ZeroConfigFatJarApplication.java new file mode 100644 index 00000000..0b07351b --- /dev/null +++ b/projects-to-be-tested/maven/spring/zero-config-fatjar/src/main/java/org/eclipse/jkube/integrationtests/springboot/zeroconfigfatjar/ZeroConfigFatJarApplication.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2019 Red Hat, Inc. + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at: + * + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Red Hat, Inc. - initial API and implementation + */ +package org.eclipse.jkube.integrationtests.springboot.zeroconfigfatjar; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class ZeroConfigFatJarApplication { + + public static void main(String[] args) { + SpringApplication.run(ZeroConfigFatJarApplication.class, args); + } + +} diff --git a/projects-to-be-tested/maven/spring/zero-config-fatjar/src/main/java/org/eclipse/jkube/integrationtests/springboot/zeroconfigfatjar/ZeroConfigFatJarResource.java b/projects-to-be-tested/maven/spring/zero-config-fatjar/src/main/java/org/eclipse/jkube/integrationtests/springboot/zeroconfigfatjar/ZeroConfigFatJarResource.java new file mode 100644 index 00000000..b85692a2 --- /dev/null +++ b/projects-to-be-tested/maven/spring/zero-config-fatjar/src/main/java/org/eclipse/jkube/integrationtests/springboot/zeroconfigfatjar/ZeroConfigFatJarResource.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2019 Red Hat, Inc. + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at: + * + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Red Hat, Inc. - initial API and implementation + */ +package org.eclipse.jkube.integrationtests.springboot.zeroconfigfatjar; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/") +public class ZeroConfigFatJarResource { + + @GetMapping + public String zeroConfig() { + return "Zero Config"; + } +} diff --git a/projects-to-be-tested/maven/spring/zero-config/pom.xml b/projects-to-be-tested/maven/spring/zero-config/pom.xml index 5626da4f..897536cc 100644 --- a/projects-to-be-tested/maven/spring/zero-config/pom.xml +++ b/projects-to-be-tested/maven/spring/zero-config/pom.xml @@ -36,10 +36,12 @@ org.springframework.boot spring-boot-starter + ${spring-boot.version} org.springframework.boot spring-boot-starter-web + ${spring-boot.version} compile @@ -49,6 +51,7 @@ org.springframework.boot spring-boot-maven-plugin + ${spring-boot.version}