Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App Engine Standard should always use the uberjar #21634

Merged
merged 1 commit into from
Nov 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 8 additions & 15 deletions docs/src/main/asciidoc/deploying-to-google-cloud.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,17 @@ runtime: java11

This will create a default service for your App Engine application.

Then, you can choose to build the application by yourself or letting `gcloud` or the Google Cloud Maven plugin build it for you.

=== Building the application manually

Set up your application to be packaged as an uber-jar via your `application.properties` file:
App Engine Standard does not support the default Quarkus' specific packaging layout, therefore, you must set up your application to be packaged as an uber-jar via your `application.properties` file:

[source, properties]
----
quarkus.package.type=uber-jar
----

Then, you can choose to build the application manually or delegating that responsibility to `gcloud` or the Google Cloud Maven plugin.

=== Building the application manually

Use Maven to build the application using `mvn clean package`, it will generate a single JAR that contains all the classes of your application including its dependencies.

Finally, use `gcloud` to deploy your application as an App Engine service.
Expand All @@ -89,23 +89,16 @@ gcloud app deploy target/getting-started-1.0.0-SNAPSHOT-runner.jar

This command will upload your application jar and launch it on App Engine.

When done, the output will display the URL of your application (target url), you can use it with curl or directly open it in your browser using `gcloud app browse`.
When it’s done, the output will display the URL of your application (target url), you can use it with curl or directly open it in your browser using `gcloud app browse`.

=== Building the application via gcloud

You can choose to let `gcloud` build your application for you, this is the simplest way to deploy to App Engine.

In this case, you need to configure your application to be packaged as an uber-jar in your `application.properties` file:

[source, properties]
----
quarkus.package.type=uber-jar
----

Then, you can just launch `gcloud app deploy` in the root of your project, it will upload all your project files (the list can be reduced via the `.gcloudignore` file),
package your JAR via Maven (or Gradle) and launch it on App Engine.

When done, the output will display the URL of your application (target url), you can use it with curl or directly open it in your browser using `gcloud app browse`.
When it’s done, the output will display the URL of your application (target url), you can use it with curl or directly open it in your browser using `gcloud app browse`.

=== Building the application via the Google Cloud Maven plugin

Expand All @@ -122,7 +115,7 @@ First, add the plugin to your `pom.xml`:
<configuration>
<projectId>GCLOUD_CONFIG</projectId> <1>
<version>gettingstarted</version>
<artifact>${project.build.directory}/quarkus-app/quarkus-run.jar</artifact> <2>
<artifact>${project.build.directory}/${project.artifactId}-${project.version}-runner.jar</artifact> <2>
</configuration>
</plugin>
----
Expand Down