Skip to content

Commit bcb69c0

Browse files
ludochgae-java-bot
authored andcommitted
PiperOrigin-RevId: 464283128 Change-Id: I2d81b6f1592821dbcff06ce0dcbeb9241885690b
1 parent 57a6257 commit bcb69c0

12 files changed

Lines changed: 407 additions & 0 deletions

File tree

applications/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@
3030
</properties>
3131
<modules>
3232
<module>proberapp</module>
33+
<module>springboot</module>
3334
</modules>
3435
</project>

applications/springboot/pom.xml

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright 2021 Google LLC
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
https://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
20+
<modelVersion>4.0.0</modelVersion>
21+
22+
<groupId>com.google.appengine.demos</groupId>
23+
<artifactId>springboot</artifactId>
24+
<version>0.0.1-SNAPSHOT</version>
25+
<packaging>war</packaging>
26+
27+
<name>AppEngine :: springboot</name>
28+
<description>Demo project for Spring Boot</description>
29+
30+
<properties>
31+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
32+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
33+
<spring.boot.version>2.7.2</spring.boot.version>
34+
<maven.compiler.target>1.8</maven.compiler.target>
35+
<maven.compiler.source>1.8</maven.compiler.source>
36+
</properties>
37+
38+
<dependencies>
39+
<dependency>
40+
<groupId>org.springframework.boot</groupId>
41+
<artifactId>spring-boot-starter-web</artifactId>
42+
<version>${spring.boot.version}</version>
43+
<!-- Exclude Tomcat so that it doesn't conflict w/ Jetty server -->
44+
<exclusions>
45+
<exclusion>
46+
<groupId>org.springframework.boot</groupId>
47+
<artifactId>spring-boot-starter-tomcat</artifactId>
48+
</exclusion>
49+
</exclusions>
50+
</dependency>
51+
52+
<!-- Exclude any jul-to-slf4j -->
53+
<dependency>
54+
<groupId>org.slf4j</groupId>
55+
<artifactId>jul-to-slf4j</artifactId>
56+
<version>1.7.30</version>
57+
<scope>provided</scope>
58+
</dependency>
59+
60+
<!-- Include Servlet API -->
61+
<dependency>
62+
<groupId>javax.servlet</groupId>
63+
<artifactId>javax.servlet-api</artifactId>
64+
<version>3.1.0</version>
65+
<scope>provided</scope>
66+
</dependency>
67+
68+
<dependency>
69+
<groupId>org.springframework.boot</groupId>
70+
<artifactId>spring-boot-starter-test</artifactId>
71+
<version>${spring.boot.version}</version>
72+
<scope>test</scope>
73+
</dependency>
74+
<dependency>
75+
<groupId>junit</groupId>
76+
<artifactId>junit</artifactId>
77+
<version>4.13.2</version>
78+
<scope>test</scope>
79+
</dependency>
80+
</dependencies>
81+
82+
<dependencyManagement>
83+
<dependencies>
84+
<dependency>
85+
<!-- Import dependency management from Spring Boot -->
86+
<groupId>org.springframework.boot</groupId>
87+
<artifactId>spring-boot-dependencies</artifactId>
88+
<version>${spring.boot.version}</version>
89+
<type>pom</type>
90+
<scope>import</scope>
91+
</dependency>
92+
</dependencies>
93+
</dependencyManagement>
94+
95+
<build>
96+
<plugins>
97+
<plugin>
98+
<groupId>org.springframework.boot</groupId>
99+
<artifactId>spring-boot-maven-plugin</artifactId>
100+
<version>${spring.boot.version}</version>
101+
</plugin>
102+
<plugin>
103+
<groupId>com.google.cloud.tools</groupId>
104+
<artifactId>appengine-maven-plugin</artifactId>
105+
<version>2.4.3</version>
106+
<configuration>
107+
<!-- can be set w/ -DprojectId=myProjectId on command line -->
108+
<projectId>ludo-in-in</projectId>
109+
<!--promote>false</promote-->
110+
<version>demo</version>
111+
<!-- set the GAE version or use "GCLOUD_CONFIG" for an autogenerated GAE version -->
112+
</configuration>
113+
</plugin>
114+
<plugin>
115+
<artifactId>maven-war-plugin</artifactId>
116+
<version>3.3.1</version>
117+
<configuration>
118+
<failOnMissingWebXml>false</failOnMissingWebXml>
119+
</configuration>
120+
</plugin>
121+
</plugins>
122+
</build>
123+
</project>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright 2021 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.example.appengine.demos.springboot;
18+
19+
import org.springframework.web.bind.annotation.GetMapping;
20+
import org.springframework.web.bind.annotation.RestController;
21+
22+
@RestController
23+
public class HelloworldController {
24+
@GetMapping("/")
25+
public String hello() {
26+
return "Hello world - springboot-appengine-standard!";
27+
}
28+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright 2021 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.example.appengine.demos.springboot;
18+
19+
import org.springframework.boot.builder.SpringApplicationBuilder;
20+
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
21+
22+
public class ServletInitializer extends SpringBootServletInitializer {
23+
24+
@Override
25+
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
26+
return application.sources(SpringBootExampleApplication.class);
27+
}
28+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright 2021 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.example.appengine.demos.springboot;
18+
19+
import org.springframework.boot.SpringApplication;
20+
import org.springframework.boot.autoconfigure.SpringBootApplication;
21+
22+
@SpringBootApplication
23+
public class SpringBootExampleApplication {
24+
25+
public static void main(String[] args) {
26+
SpringApplication.run(SpringBootExampleApplication.class, args);
27+
}
28+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#
2+
# Copyright 2021 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# A default java.util.logging configuration.
17+
# (All App Engine logging is through java.util.logging by default).
18+
#
19+
# To use this configuration, copy it into your application's WEB-INF
20+
# folder and add the following to your appengine-web.xml:
21+
#
22+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#
2+
# Copyright 2021 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
logging:
18+
level.ROOT: DEBUG
19+
level.org.springframework.test.web.servlet.result: DEBUG
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#
2+
# Copyright 2021 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# A default java.util.logging configuration.
17+
# (All App Engine logging is through java.util.logging by default).
18+
#
19+
# To use this configuration, copy it into your application's WEB-INF
20+
# folder and add the following to your appengine-web.xml:
21+
#
22+
# <system-properties>
23+
# <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
24+
# </system-properties>
25+
#
26+
27+
.level = INFO
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright 2021 Google LLC
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
https://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
18+
<runtime>java17</runtime>
19+
<system-properties>
20+
<property name="java.util.logging.config.file" value="WEB-INF/classes/logging.properties"/>
21+
</system-properties>
22+
<instance-class>F4</instance-class>
23+
</appengine-web-app>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright 2021 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.example.appengine.demos.springboot;
18+
19+
import org.junit.Test;
20+
import org.junit.runner.RunWith;
21+
import org.springframework.boot.test.context.SpringBootTest;
22+
import org.springframework.test.context.junit4.SpringRunner;
23+
24+
@RunWith(SpringRunner.class)
25+
@SpringBootTest
26+
public class SpringBootExampleApplicationTests {
27+
28+
@Test
29+
public void contextLoads() {}
30+
}

0 commit comments

Comments
 (0)