From 797dcd6a5a163975f2f108b7b8e7a3773bcb2b0a Mon Sep 17 00:00:00 2001
From: buildmaster
Date: Wed, 20 May 2020 22:36:47 +0000
Subject: [PATCH] Sync docs from master to gh-pages
---
reference/html/gcp-intro.html | 79 ++++++++++-------------------------
reference/html/gcp.html | 79 ++++++++++-------------------------
2 files changed, 44 insertions(+), 114 deletions(-)
diff --git a/reference/html/gcp-intro.html b/reference/html/gcp-intro.html
index db721403e..e8ea68cf1 100644
--- a/reference/html/gcp-intro.html
+++ b/reference/html/gcp-intro.html
@@ -158,7 +158,7 @@ public class CloudFunctionMain {
<artifactId>function-maven-plugin</artifactId>
<version>0.9.1</version>
<configuration>
- <functionTarget>org.springframework.cloud.function.adapter.gcp.FunctionInvoker</functionTarget>
+ <functionTarget>org.springframework.cloud.function.adapter.gcp.GcfJarLauncher</functionTarget>
<port>8080</port>
</configuration>
</plugin>
@@ -196,73 +196,37 @@ public class CloudFunctionMain {
You can get on the whitelist to try it out.
-
To deploy to Google Cloud Function, you need to produce a fat jar using the Shade plugin, rather than the Spring Boot plugin.
-
-
-
First, if you already have the Spring Boot plugin in your pom.xml, remove it:
+
In order to use the adapter, first add the dependency to your pom.xml:
-
<!-- Remove this block by deleting or commenting it out -->
-<!--
-<plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
-</plugin>
--->
+
<dependency>
+ <groupId>org.springframework.cloud</groupId>
+ <artifactId>spring-cloud-function-adapter-gcp</artifactId>
+</dependency>
-
Then, add the Shade Plugin configuration to generate a fat jar when you run the mvn package command.
+
Then, add the spring-boot-maven-plugin with spring-cloud-function-adapter-gcp as a dependency.
+The extra dependency is used for spring-boot-maven-plugin to package your function in the correct JAR format for deployment on Google Cloud Functions.
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <shadedArtifactAttached>true</shadedArtifactAttached>
- <outputDirectory>target/deploy</outputDirectory>
- <shadedClassifierName>gcp</shadedClassifierName>
- <transformers>
- <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
- <resource>META-INF/spring.handlers</resource>
- </transformer>
- <transformer implementation="org.springframework.boot.maven.PropertiesMergingResourceTransformer">
- <resource>META-INF/spring.factories</resource>
- </transformer>
- <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
- <resource>META-INF/spring.schemas</resource>
- </transformer>
- <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
- <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
- <mainClass>com.example.CloudFunctionMain</mainClass>
- </transformer>
- </transformers>
- </configuration>
- </execution>
- </executions>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <configuration>
+ <outputDirectory>target/deploy</outputDirectory>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.cloud</groupId>
+ <artifactId>spring-cloud-function-adapter-gcp</artifactId>
+ </dependency>
+ </dependencies>
</plugin>
-
-
-
-|
-
- |
-
-If both Spring Boot plugin and Shade plugin are present, Shade plugin may be shading a Spring Boot produced JAR, resulting in a Fat JAR that’s unusable in Google Cloud Function. Don’t forget to remove the Spring Boot plugin!
- |
-
-
-
@@ -272,7 +236,8 @@ If both Spring Boot plugin and Shade plugin are present, Shade plugin may be sha
-
You should see the fat jar in target/deploy directory.
+
You should see the resulting JAR in target/deploy directory.
+This JAR is correctly formatted for deployment to Google Cloud Functions.
Make sure that you have the Cloud SDK CLI installed.
@@ -283,7 +248,7 @@ If both Spring Boot plugin and Shade plugin are present, Shade plugin may be sha
gcloud alpha functions deploy function-sample-gcp \
---entry-point org.springframework.cloud.function.adapter.gcp.FunctionInvoker \
+--entry-point org.springframework.cloud.function.adapter.gcp.GcfJarLauncher \
--runtime java11 \
--trigger-http \
--source target/deploy \
diff --git a/reference/html/gcp.html b/reference/html/gcp.html
index 43b2d7aeb..5c749b89d 100644
--- a/reference/html/gcp.html
+++ b/reference/html/gcp.html
@@ -165,7 +165,7 @@ public class CloudFunctionMain {
<artifactId>function-maven-plugin</artifactId>
<version>0.9.1</version>
<configuration>
- <functionTarget>org.springframework.cloud.function.adapter.gcp.FunctionInvoker</functionTarget>
+ <functionTarget>org.springframework.cloud.function.adapter.gcp.GcfJarLauncher</functionTarget>
<port>8080</port>
</configuration>
</plugin>
@@ -203,73 +203,37 @@ public class CloudFunctionMain {
You can get on the
whitelist to try it out.
-
To deploy to Google Cloud Function, you need to produce a fat jar using the Shade plugin, rather than the Spring Boot plugin.
-
-
-
First, if you already have the Spring Boot plugin in your pom.xml, remove it:
+
In order to use the adapter, first add the dependency to your pom.xml:
-
<!-- Remove this block by deleting or commenting it out -->
-<!--
-<plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
-</plugin>
--->
+
<dependency>
+ <groupId>org.springframework.cloud</groupId>
+ <artifactId>spring-cloud-function-adapter-gcp</artifactId>
+</dependency>
-
Then, add the Shade Plugin configuration to generate a fat jar when you run the mvn package command.
+
Then, add the spring-boot-maven-plugin with spring-cloud-function-adapter-gcp as a dependency.
+The extra dependency is used for spring-boot-maven-plugin to package your function in the correct JAR format for deployment on Google Cloud Functions.
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <shadedArtifactAttached>true</shadedArtifactAttached>
- <outputDirectory>target/deploy</outputDirectory>
- <shadedClassifierName>gcp</shadedClassifierName>
- <transformers>
- <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
- <resource>META-INF/spring.handlers</resource>
- </transformer>
- <transformer implementation="org.springframework.boot.maven.PropertiesMergingResourceTransformer">
- <resource>META-INF/spring.factories</resource>
- </transformer>
- <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
- <resource>META-INF/spring.schemas</resource>
- </transformer>
- <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
- <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
- <mainClass>com.example.CloudFunctionMain</mainClass>
- </transformer>
- </transformers>
- </configuration>
- </execution>
- </executions>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <configuration>
+ <outputDirectory>target/deploy</outputDirectory>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.cloud</groupId>
+ <artifactId>spring-cloud-function-adapter-gcp</artifactId>
+ </dependency>
+ </dependencies>
</plugin>
-
-
-
-|
-
- |
-
-If both Spring Boot plugin and Shade plugin are present, Shade plugin may be shading a Spring Boot produced JAR, resulting in a Fat JAR that’s unusable in Google Cloud Function. Don’t forget to remove the Spring Boot plugin!
- |
-
-
-
@@ -279,7 +243,8 @@ If both Spring Boot plugin and Shade plugin are present, Shade plugin may be sha
-
You should see the fat jar in target/deploy directory.
+
You should see the resulting JAR in target/deploy directory.
+This JAR is correctly formatted for deployment to Google Cloud Functions.
Make sure that you have the Cloud SDK CLI installed.
@@ -290,7 +255,7 @@ If both Spring Boot plugin and Shade plugin are present, Shade plugin may be sha
gcloud alpha functions deploy function-sample-gcp \
---entry-point org.springframework.cloud.function.adapter.gcp.FunctionInvoker \
+--entry-point org.springframework.cloud.function.adapter.gcp.GcfJarLauncher \
--runtime java11 \
--trigger-http \
--source target/deploy \