From c6a9c3033a75a08a93fe808897afb2af4c2b46cf Mon Sep 17 00:00:00 2001 From: John Martin <48291409+jomartin-999@users.noreply.github.com> Date: Wed, 2 Nov 2022 16:49:38 -0400 Subject: [PATCH 1/3] Updated the HelloWorld Starter App Updated the Hello World application --- hello-world/build.gradle | 21 ++++++++++--------- hello-world/gradle.properties | 2 ++ .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../helloworld/HelloWorldApplication.java | 4 ++-- 4 files changed, 16 insertions(+), 13 deletions(-) create mode 100644 hello-world/gradle.properties diff --git a/hello-world/build.gradle b/hello-world/build.gradle index 8f469a2..8011411 100644 --- a/hello-world/build.gradle +++ b/hello-world/build.gradle @@ -4,8 +4,8 @@ */ plugins { - id 'org.springframework.boot' version '2.4.1' - id 'io.spring.dependency-management' version '1.0.10.RELEASE' + id 'org.springframework.boot' version '2.7.4' + id 'io.spring.dependency-management' version '1.0.15.RELEASE' id 'java' } @@ -19,26 +19,27 @@ bootBuildImage{ repositories { mavenCentral() + maven { + credentials { + username "$gemfireRepoUsername" + password "$gemfireRepoPassword" + } + url = uri("https://commercial-repo.pivotal.io/data3/gemfire-release-repo/gemfire") + } } -ext { - set('springGeodeVersion', "1.4.0") -} dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.geode:spring-geode-starter' + implementation "com.vmware.gemfire:spring-gemfire-starter-9.15:2.7.0" } dependencyManagement { dependencies { - dependencySet(group: 'org.apache.logging.log4j', version: '2.16.0') { + dependencySet(group: 'org.apache.logging.log4j', version: '2.19.0') { entry('log4j-api') entry('log4j-core') entry('log4j-to-slf4j') } } - imports { - mavenBom "org.springframework.geode:spring-geode-bom:${springGeodeVersion}" - } } diff --git a/hello-world/gradle.properties b/hello-world/gradle.properties new file mode 100644 index 0000000..712cbc8 --- /dev/null +++ b/hello-world/gradle.properties @@ -0,0 +1,2 @@ +gemfireRepoUsername=YOUR_PIVOTAL_COMMERCIAL_MAVEN_REPO_USERNAME +gemfireRepoPassword=YOUR_PIVOTAL_COMMERCIAL_MAVEN_REPO_PASSWORD \ No newline at end of file diff --git a/hello-world/gradle/wrapper/gradle-wrapper.properties b/hello-world/gradle/wrapper/gradle-wrapper.properties index 25f587d..71a1ffc 100644 --- a/hello-world/gradle/wrapper/gradle-wrapper.properties +++ b/hello-world/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip diff --git a/hello-world/src/main/java/com/vmware/tanzu/gemfire/helloworld/HelloWorldApplication.java b/hello-world/src/main/java/com/vmware/tanzu/gemfire/helloworld/HelloWorldApplication.java index a9ed5cc..aa2c622 100644 --- a/hello-world/src/main/java/com/vmware/tanzu/gemfire/helloworld/HelloWorldApplication.java +++ b/hello-world/src/main/java/com/vmware/tanzu/gemfire/helloworld/HelloWorldApplication.java @@ -8,11 +8,11 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.data.gemfire.config.annotation.EnableCachingDefinedRegions; +import org.springframework.data.gemfire.config.annotation.EnableClusterDefinedRegions; import org.springframework.geode.config.annotation.EnableClusterAware; @SpringBootApplication -@EnableCachingDefinedRegions -@EnableClusterAware +@EnableClusterDefinedRegions public class HelloWorldApplication { From efc0f65f035606563d74542599bec0aea04a6f3a Mon Sep 17 00:00:00 2001 From: John Martin <48291409+jomartin-999@users.noreply.github.com> Date: Wed, 2 Nov 2022 16:51:27 -0400 Subject: [PATCH 2/3] Removed Tanzu from the example. --- hello-world/README.md | 6 ------ hello-world/build.gradle | 2 +- hello-world/manifest.yml | 2 +- .../gemfire/helloworld/HelloWorldApplication.java | 4 +--- .../gemfire/helloworld/HelloWorldController.java | 2 +- .../{tanzu => }/gemfire/helloworld/HelloWorldService.java | 2 +- hello-world/src/main/resources/application.properties | 2 +- 7 files changed, 6 insertions(+), 14 deletions(-) rename hello-world/src/main/java/com/vmware/{tanzu => }/gemfire/helloworld/HelloWorldApplication.java (70%) rename hello-world/src/main/java/com/vmware/{tanzu => }/gemfire/helloworld/HelloWorldController.java (95%) rename hello-world/src/main/java/com/vmware/{tanzu => }/gemfire/helloworld/HelloWorldService.java (95%) diff --git a/hello-world/README.md b/hello-world/README.md index d55d51c..ff9d18b 100644 --- a/hello-world/README.md +++ b/hello-world/README.md @@ -6,9 +6,3 @@ SPDX-License-Identifier: Apache-2.0 # Hello, World! Code Example The *Hello, World!* example app is a small and simple application that was created to test your various environment setups. When you run the app the first time, it simulates a query to a backend data source. Then, on subsequent queries for that data, it demonstrates how caching that data can improve your apps read performance. - -The *Hello, World!* app is used by the following guides: - -- [Set Up Your Local Envinroment](https://tanzu.vmware.com/developer/data/tanzu-gemfire/guides/get-started-locally-sbdg/) -- [Set Up Tanzu GemFire on TAS](https://tanzu.vmware.com/developer/data/tanzu-gemfire/guides/get-started-tgf4vms-sbdg/) -- [Set Up Tanzu GemFire on Kubernetes](https://tanzu.vmware.com/developer/data/tanzu-gemfire/guides/get-started-tgf4k8s-sbdg/) \ No newline at end of file diff --git a/hello-world/build.gradle b/hello-world/build.gradle index 8011411..5a04da0 100644 --- a/hello-world/build.gradle +++ b/hello-world/build.gradle @@ -9,7 +9,7 @@ plugins { id 'java' } -group = 'com.vmware.tanzu.gemfire.helloworld' +group = 'com.vmware.gemfire.helloworld' version = '0.0.1-SNAPSHOT' sourceCompatibility = '1.8' diff --git a/hello-world/manifest.yml b/hello-world/manifest.yml index 37b761e..ffd4812 100644 --- a/hello-world/manifest.yml +++ b/hello-world/manifest.yml @@ -6,4 +6,4 @@ applications: - name: helloworld path: ./build/libs/hello-world-0.0.1-SNAPSHOT.jar services: - - + - diff --git a/hello-world/src/main/java/com/vmware/tanzu/gemfire/helloworld/HelloWorldApplication.java b/hello-world/src/main/java/com/vmware/gemfire/helloworld/HelloWorldApplication.java similarity index 70% rename from hello-world/src/main/java/com/vmware/tanzu/gemfire/helloworld/HelloWorldApplication.java rename to hello-world/src/main/java/com/vmware/gemfire/helloworld/HelloWorldApplication.java index aa2c622..f18325a 100644 --- a/hello-world/src/main/java/com/vmware/tanzu/gemfire/helloworld/HelloWorldApplication.java +++ b/hello-world/src/main/java/com/vmware/gemfire/helloworld/HelloWorldApplication.java @@ -3,13 +3,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -package com.vmware.tanzu.gemfire.helloworld; +package com.vmware.gemfire.helloworld; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.data.gemfire.config.annotation.EnableCachingDefinedRegions; import org.springframework.data.gemfire.config.annotation.EnableClusterDefinedRegions; -import org.springframework.geode.config.annotation.EnableClusterAware; @SpringBootApplication @EnableClusterDefinedRegions diff --git a/hello-world/src/main/java/com/vmware/tanzu/gemfire/helloworld/HelloWorldController.java b/hello-world/src/main/java/com/vmware/gemfire/helloworld/HelloWorldController.java similarity index 95% rename from hello-world/src/main/java/com/vmware/tanzu/gemfire/helloworld/HelloWorldController.java rename to hello-world/src/main/java/com/vmware/gemfire/helloworld/HelloWorldController.java index 90b8c4a..60b6903 100644 --- a/hello-world/src/main/java/com/vmware/tanzu/gemfire/helloworld/HelloWorldController.java +++ b/hello-world/src/main/java/com/vmware/gemfire/helloworld/HelloWorldController.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -package com.vmware.tanzu.gemfire.helloworld; +package com.vmware.gemfire.helloworld; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/hello-world/src/main/java/com/vmware/tanzu/gemfire/helloworld/HelloWorldService.java b/hello-world/src/main/java/com/vmware/gemfire/helloworld/HelloWorldService.java similarity index 95% rename from hello-world/src/main/java/com/vmware/tanzu/gemfire/helloworld/HelloWorldService.java rename to hello-world/src/main/java/com/vmware/gemfire/helloworld/HelloWorldService.java index 146573d..6384b4c 100644 --- a/hello-world/src/main/java/com/vmware/tanzu/gemfire/helloworld/HelloWorldService.java +++ b/hello-world/src/main/java/com/vmware/gemfire/helloworld/HelloWorldService.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -package com.vmware.tanzu.gemfire.helloworld; +package com.vmware.gemfire.helloworld; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; diff --git a/hello-world/src/main/resources/application.properties b/hello-world/src/main/resources/application.properties index 33ce260..79b9542 100644 --- a/hello-world/src/main/resources/application.properties +++ b/hello-world/src/main/resources/application.properties @@ -3,6 +3,6 @@ # SPDX-License-Identifier: Apache-2.0 # -#Properties used to connect to a Tanzu GemFire for Kubernetes instance. +#Properties used to connect to a VMware GemFire for Kubernetes instance. #spring.data.gemfire.pool.locators: hello-world-gemfire-cluster-locator-0.hello-world-gemfire-cluster-locator.tanzu-gemfire[10334] #spring.data.gemfire.management.http.host: hello-world-gemfire-cluster-locator-0.hello-world-gemfire-cluster-locator.tanzu-gemfire \ No newline at end of file From 64b20515320b956c2046e5188b6c6d07bcd91340 Mon Sep 17 00:00:00 2001 From: John Martin <48291409+jomartin-999@users.noreply.github.com> Date: Thu, 10 Nov 2022 11:42:22 -0500 Subject: [PATCH 3/3] Updated build.gradle file to the new artifact name. --- hello-world/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hello-world/build.gradle b/hello-world/build.gradle index 5a04da0..64889b2 100644 --- a/hello-world/build.gradle +++ b/hello-world/build.gradle @@ -31,7 +31,7 @@ repositories { dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' - implementation "com.vmware.gemfire:spring-gemfire-starter-9.15:2.7.0" + implementation "com.vmware.gemfire:spring-boot-2.7-gemfire-9.15:1.0.0" } dependencyManagement {