diff --git a/spring-cloud-function-adapters/spring-cloud-function-adapter-gcp/src/main/java/org/springframework/cloud/function/adapter/gcp/GcfJarLauncher.java b/spring-cloud-function-adapters/spring-cloud-function-adapter-gcp/src/main/java/org/springframework/cloud/function/adapter/gcp/GcfJarLauncher.java index fc7b6b5cb..f96200709 100644 --- a/spring-cloud-function-adapters/spring-cloud-function-adapter-gcp/src/main/java/org/springframework/cloud/function/adapter/gcp/GcfJarLauncher.java +++ b/spring-cloud-function-adapters/spring-cloud-function-adapter-gcp/src/main/java/org/springframework/cloud/function/adapter/gcp/GcfJarLauncher.java @@ -16,7 +16,8 @@ package org.springframework.cloud.function.adapter.gcp; -import java.util.List; +import java.util.Collections; +import java.util.Iterator; import com.google.cloud.functions.Context; import com.google.cloud.functions.HttpFunction; @@ -27,7 +28,6 @@ import com.google.cloud.functions.RawBackgroundFunction; import org.springframework.boot.loader.JarLauncher; import org.springframework.boot.loader.archive.Archive; import org.springframework.boot.loader.jar.JarFile; -import org.springframework.util.CollectionUtils; /** * The launcher class written at the top-level of the output JAR to be deployed to @@ -65,12 +65,14 @@ public class GcfJarLauncher extends JarLauncher implements HttpFunction, RawBack ((RawBackgroundFunction) delegate).accept(json, context); } - private List discoverClassPathAcrhives() throws Exception { - List classPathArchives = getClassPathArchives(); - if (CollectionUtils.isEmpty(classPathArchives)) { - classPathArchives.add(this.getArchive()); + private Iterator discoverClassPathAcrhives() throws Exception { + Iterator classPathArchives = getClassPathArchivesIterator(); + if (classPathArchives.hasNext()) { + return classPathArchives; + } + else { + return Collections.singleton(this.getArchive()).iterator(); } - return classPathArchives; } } diff --git a/spring-cloud-function-samples/function-sample-gcp-background/pom.xml b/spring-cloud-function-samples/function-sample-gcp-background/pom.xml index dde8bf895..d7bedd53e 100644 --- a/spring-cloud-function-samples/function-sample-gcp-background/pom.xml +++ b/spring-cloud-function-samples/function-sample-gcp-background/pom.xml @@ -19,11 +19,15 @@ + + 3.0.8.BUILD-SNAPSHOT + + org.springframework.cloud spring-cloud-function-adapter-gcp - 3.1.0.BUILD-SNAPSHOT + ${spring-cloud-function.version} @@ -46,7 +50,7 @@ org.springframework.cloud spring-cloud-function-adapter-gcp - 3.1.0.BUILD-SNAPSHOT + ${spring-cloud-function.version} diff --git a/spring-cloud-function-samples/function-sample-gcp-http/pom.xml b/spring-cloud-function-samples/function-sample-gcp-http/pom.xml index 8239f051d..bdb25bb61 100644 --- a/spring-cloud-function-samples/function-sample-gcp-http/pom.xml +++ b/spring-cloud-function-samples/function-sample-gcp-http/pom.xml @@ -19,11 +19,15 @@ + + 3.0.8.BUILD-SNAPSHOT + + org.springframework.cloud spring-cloud-function-adapter-gcp - 3.1.0.BUILD-SNAPSHOT + ${spring-cloud-function.version} @@ -74,7 +78,7 @@ org.springframework.cloud spring-cloud-function-adapter-gcp - 3.1.0.BUILD-SNAPSHOT + ${spring-cloud-function.version}