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

Ludo java21 #9882

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions appengine-java8/README.md → appengine-java21/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Google App Engine Standard Environment Samples for Java 8
# Google App Engine Standard Environment Samples for Java 21

<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=appengine-java8/README.md">
<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=appengine-java21/README.md">
<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a>

This is a repository that contains Java code samples for [Google App Engine
Expand Down Expand Up @@ -43,7 +43,7 @@ access control, billing, and services.
This sample demonstrates how to deploy an application on Google App Engine.

- [Documentation][ae-docs]
- [Code](https://github.com/GoogleCloudPlatform/getting-started-java/tree/main/appengine-standard-java8/helloworld)
- [Code](https://github.com/GoogleCloudPlatform/getting-started-java/tree/main/appengine-standard-java21/helloworld)

### Sending Email

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Google Analytics sample for Google App Engine

<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=appengine-java8/analytics/README.md">
<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=appengine-java21/analytics/README.md">
<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a>

Integrating App Engine with Google Analytics.
Expand All @@ -14,7 +14,7 @@ and set it as an environment variable in [`appengine-web.xml`](src/main/webapp/W

## Running locally
This example uses the
[Maven Cloud SDK based plugin](https://cloud.google.com/appengine/docs/java/tools/using-maven).
[Maven Cloud CLI based plugin](https://cloud.google.com/appengine/docs/java/tools/using-maven).
To run this sample locally:

$ mvn appengine:run
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Copyright 2017 Google Inc.
Copyright 2024 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -19,7 +19,7 @@
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<groupId>com.example.appengine</groupId>
<artifactId>appengine-analytics-j8</artifactId>
<artifactId>appengine-analytics-j21</artifactId>

<!--
The parent pom defines common style checks and testing strategies for our samples.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2015 Google Inc.
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- [START_EXCLUDE] -->
<!--
Copyright 2015 Google Inc.
Copyright 2024 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand All @@ -14,9 +14,14 @@
-->
<!-- [END_EXCLUDE] -->
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<threadsafe>true</threadsafe>
<runtime>java8</runtime>
<env-variables>

<runtime>java21</runtime>
<app-engine-apis>true</app-engine-apis>
<system-properties>
<property name="appengine.use.EE8" value="true"/>
ludoch marked this conversation as resolved.
Show resolved Hide resolved
</system-properties>

<env-variables>
<env-var name="GA_TRACKING_ID" value="YOUR-GA-TRACKING-ID" />
</env-variables>
</appengine-web-app>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- [START_EXCLUDE] -->
<!--
Copyright 2015 Google Inc.
Copyright 2024 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# App Identity sample for Google App Engine

<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=appengine-java8/appidentity/README.md">
<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=appengine-java21/appidentity/README.md">
<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a>


Expand All @@ -12,7 +12,7 @@ Engine][ae-docs].

## Running locally
This example uses the
[Maven Cloud SDK based plugin](https://cloud.google.com/appengine/docs/java/tools/using-maven).
[Maven Cloud CLI based plugin](https://cloud.google.com/appengine/docs/java/tools/using-maven).
To run this sample locally:

$ mvn appengine:run
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Copyright 2015 Google Inc.
Copyright 2024 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -20,7 +20,7 @@
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<groupId>com.example.appengine</groupId>
<artifactId>appengine-appidentity-j8</artifactId>
<artifactId>appengine-appidentity-j21</artifactId>

<!--
The parent pom defines common style checks and testing strategies for our samples.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2015 Google Inc.
* Copyright 2024 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leave the year to 2015. Inc to LLC is correct.

*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,6 +32,7 @@
)
public class IdentityServlet extends HttpServlet {

// [START gae_java21_app_identity_versioned_hostnames]
@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
resp.setContentType("text/plain");
Expand All @@ -40,4 +41,5 @@ public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOExc
resp.getWriter()
.println(env.getAttributes().get("com.google.appengine.runtime.default_version_hostname"));
}
// [END gae_java21_app_identity_versioned_hostnames]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016 Google Inc.
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -54,7 +54,7 @@ public SignForAppServlet() {
appIdentity = AppIdentityServiceFactory.getAppIdentityService();
}

// [START gae_java8_app_identity_other_services]
// [START gae_java21_app_identity_other_services]
// Note that the algorithm used by AppIdentity.signForApp() and
// getPublicCertificatesForApp() is "SHA256withRSA"

Expand Down Expand Up @@ -102,7 +102,7 @@ private String simulateIdentityAssertion()
"isValid=%b for message: %s\n\tsignature: %s\n\tpublic cert: %s",
isValid, message, Arrays.toString(blobSignature), Arrays.toString(publicCert));
}
// [END gae_java8_app_identity_other_services]
// [END gae_java21_app_identity_other_services]

@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016 Google Inc.
* Copyright 2024 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep copyright year as 2016

*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -31,7 +31,7 @@

@SuppressWarnings("serial")
class UrlShortener {
// [START gae_java8_app_identity_google_apis]
// [START gae_java21_app_identity_google_apis]

/**
* Returns a shortened URL by calling the Google URL Shortener API.
Expand Down Expand Up @@ -74,5 +74,5 @@ public String createShortUrl(String longUrl) throws Exception {
}
}
}
// [END gae_java8_app_identity_google_apis]
// [END gae_java21_app_identity_google_apis]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016 Google Inc.
* Copyright 2024 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep copyright year as original

*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">

<runtime>java21</runtime>
<app-engine-apis>true</app-engine-apis>
<system-properties>
<property name="appengine.use.EE8" value="true"/>
</system-properties>

</appengine-web-app>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2015 Google Inc.
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016 Google Inc.
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=appengine-java8/bigquery/README.md">
<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=appengine-java21/bigquery/README.md">
<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a>

# Google Cloud API Showcase: BigQuery & Cloud Monitoring in App Engine standard environment for Java 8
# Google Cloud API Showcase: BigQuery & Cloud Monitoring in App Engine standard environment for Java 21

This API Showcase demonstrates how to run an App Engine standard environment application with dependencies on both
[Google BigQuery][bigquery] and [StackDriver Monitoring][monitoring].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think [StackDriver Monitoring] needs to get updated to Cloud Monitoring

Expand All @@ -16,11 +16,11 @@ The home page also provides a summary view of the metrics that have been logged

## Clone the sample app

Copy the sample apps to your local machine, and cd to the `appengine-java8/bigquery` directory:
Copy the sample apps to your local machine, and cd to the `appengine-java21/bigquery` directory:

```
git clone https://github.com/GoogleCloudPlatform/java-docs-samples
cd appengine-java8/bigquery
cd appengine-java21/bigquery
```

## Setup
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Copyright 2018 Google Inc.
Copyright 2024 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leave the original copyright year


Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -20,7 +20,7 @@
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<groupId>com.example.appengine</groupId>
<artifactId>appengine-bigquery-monitoring-j8</artifactId>
<artifactId>appengine-bigquery-monitoring-j21</artifactId>

<!--
The parent pom defines common style checks and testing strategies for our samples.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Google Inc.
* Copyright 2024 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leave the original year

*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Google Inc.
* Copyright 2024 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leave the original year

*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Google Inc.
* Copyright 2024 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leave the original year

*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Google Inc.
* Copyright 2024 Google LLC
ludoch marked this conversation as resolved.
Show resolved Hide resolved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">

<runtime>java21</runtime>
<app-engine-apis>true</app-engine-apis>
<system-properties>
<property name="appengine.use.EE8" value="true"/>
</system-properties>

<application>dzlier-work</application>
</appengine-web-app>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Google Inc.
* Copyright 2024 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leave the original year

*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Bigtable-hello-j8
Bigtable-hello-j21
=================

<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=appengine-java8/bigtable/README.md">
<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=appengine-java21/bigtable/README.md">
<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a>

Moves the Bigtable Hello World application to Google App Engine Standard for Java 8.
Moves the Bigtable Hello World application to Google App Engine Standard for Java 21.


* [Java 8](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
* [Java 21](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
* [Maven](https://maven.apache.org/download.cgi) (at least 3.3.9)
* [Gradle](https://gradle.org)
* [Google Cloud SDK](https://cloud.google.com/sdk/) (aka gcloud)
* [Google Cloud CLI](https://cloud.google.com/sdk/) (aka gcloud)

Initialize the Google Cloud SDK using:
Initialize the Google Cloud CLI using:

gcloud init

Expand All @@ -27,7 +27,7 @@ Then you need to [Create a Cloud Bigtable Instance](https://cloud.google.com/big

mvn -Dbigtable.projectID=PROJECTID -Dbigtable.instanceID=INSTANCEID appengine:run

### Deploy to App Engine Standard for Java 8
### Deploy to App Engine Standard for Java 21

mvn -Dbigtable.projectID=PROJECTID -Dbigtable.instanceID=INSTANCEID package appengine:deploy

Expand All @@ -41,7 +41,7 @@ Then you need to [Create a Cloud Bigtable Instance](https://cloud.google.com/big

gradle -Dbigtable.projectID=PROJECTID -Dbigtable.instanceID=INSTANCEID appengineRun

### Integration Tests & Deploy to App Engine Standard for Java 8
### Integration Tests & Deploy to App Engine Standard for Java 21

gradle -Dbigtable.projectID=PROJECTID -Dbigtable.instanceID=INSTANCEID appengineDeploy

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017 Google Inc.
// Copyright 2024 Google LLC
//
ludoch marked this conversation as resolved.
Show resolved Hide resolved
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -31,8 +31,8 @@ apply plugin: 'com.google.cloud.tools.appengine'
group = 'com.example.google.cloud.bigtable'
version = '0.1-SNAPSHOT'

sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = 17
targetCompatibility = 17
ludoch marked this conversation as resolved.
Show resolved Hide resolved

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2016 Google Inc.
Copyright 2024 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -21,7 +21,7 @@ limitations under the License.
<version>0.1-SNAPSHOT</version>

<groupId>com.example.appengine</groupId>
<artifactId>bigtable-hello-j8</artifactId>
<artifactId>bigtable-hello-j21</artifactId>

<!--
The parent pom defines common style checks and testing strategies for our samples.
Expand Down
Loading
Loading