Skip to content

Commit

Permalink
feat: upgrade to java 21
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli committed Nov 16, 2023
1 parent c96da4b commit 6356a8c
Show file tree
Hide file tree
Showing 41 changed files with 783 additions and 197 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/aws-cloudwatch-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
- name: Set up JDK
uses: actions/[email protected]
with:
java-version: 17
distribution: 'zulu'
java-version: 21
distribution: 'temurin'
cache: 'maven'

- name: Build and analyze
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/aws-dynamo-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: ${{ matrix.distribution }}
distribution: temurin
cache: 'maven'

- name: Build with Maven
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/aws-kinesis-consumer-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
- name: Set up JDK
uses: actions/[email protected]
with:
java-version: 17
distribution: 'zulu'
java-version: 21
distribution: 'temurin'
cache: 'maven'

- name: Build and analyze
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/aws-kinesis-producer-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
- name: Set up JDK
uses: actions/[email protected]
with:
java-version: 17
distribution: 'zulu'
java-version: 21
distribution: 'temurin'
cache: 'maven'

- name: Build and analyze
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/aws-parameterstore-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: 17
distribution: 'zulu'
java-version: 21
distribution: 'temurin'
cache: 'maven'
- name: Build and analyze
run: ./mvnw clean verify
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/aws-s3-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
- name: Set up JDK
uses: actions/[email protected]
with:
java-version: 17
distribution: 'zulu'
java-version: 21
distribution: 'temurin'
cache: 'maven'

- name: Build and analyze
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/aws-secretmanager-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
- name: Set up JDK
uses: actions/[email protected]
with:
java-version: 17
distribution: 'zulu'
java-version: 21
distribution: 'temurin'
cache: 'maven'
- name: Build and analyze
run: ./mvnw clean verify
4 changes: 2 additions & 2 deletions .github/workflows/aws-ses-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
- name: Set up JDK
uses: actions/[email protected]
with:
java-version: 17
distribution: 'zulu'
java-version: 21
distribution: 'temurin'
cache: 'maven'

- name: Build and analyze
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/aws-sqs-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
- name: Set up JDK
uses: actions/[email protected]
with:
java-version: 17
distribution: 'zulu'
java-version: 21
distribution: 'temurin'
cache: 'maven'

- name: Build and analyze
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sonarbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu' # Alternative distribution options are available.
java-version: 21
distribution: 'temurin' # Alternative distribution options are available.
cache: 'maven'
- name: Cache SonarCloud packages
uses: actions/cache@v3
Expand Down
4 changes: 2 additions & 2 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ FROM gitpod/workspace-full:latest
USER gitpod

RUN bash -c ". /home/gitpod/.sdkman/bin/sdkman-init.sh \
&& sdk install java 17.0.7-tem \
&& sdk default java 17.0.7-tem"
&& sdk install java 21.0.1-tem \
&& sdk default java 21.0.1-tem"
9 changes: 4 additions & 5 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
github:
prebuilds:
addComment: false
addBadge: true

image:
file: .gitpod.Dockerfile

tasks:
- before: sdk install mvnd
init: mvnd verify -DskipTests

ports:
- port: 3000
visibility: public
Expand Down
Binary file added .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
18 changes: 18 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.1/apache-maven-3.9.1-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
4 changes: 2 additions & 2 deletions aws-cloudwatch-project/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<java.version>17</java.version>
<java.version>21</java.version>
<spring-cloud-aws.version>3.0.3</spring-cloud-aws.version>
<springdoc-openapi.version>2.2.0</springdoc-openapi.version>
<commons-io.version>2.15.0</commons-io.version>
Expand Down Expand Up @@ -251,7 +251,7 @@
<configuration>
<java>
<googleJavaFormat>
<version>1.15.0</version>
<version>1.18.1</version>
<style>AOSP</style>
</googleJavaFormat>
</java>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,20 @@ public LoggingAspect(Environment env) {
}

@Pointcut(
"within(@org.springframework.stereotype.Repository *)"
+ " || within(@org.springframework.stereotype.Service *)"
+ " || within(@org.springframework.web.bind.annotation.RestController *)")
"""
within(@org.springframework.stereotype.Repository *)\
|| within(@org.springframework.stereotype.Service *)\
|| within(@org.springframework.web.bind.annotation.RestController *)\
""")
public void springBeanPointcut() {
// pointcut definition
}

@Pointcut(
"@within(com.example.awsspring.config.logging.Loggable) || "
+ "@annotation(com.example.awsspring.config.logging.Loggable)")
"""
@within(com.example.awsspring.config.logging.Loggable) || \
@annotation(com.example.awsspring.config.logging.Loggable)\
""")
public void applicationPackagePointcut() {
// pointcut definition
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void shouldFetchAllCustomers() throws Exception {

@Test
void shouldFindCustomerById() throws Exception {
Customer customer = customerList.get(0);
Customer customer = customerList.getFirst();
Long customerId = customer.getId();

this.mockMvc
Expand Down Expand Up @@ -90,7 +90,7 @@ void shouldReturn400WhenCreateNewCustomerWithoutText() throws Exception {

@Test
void shouldUpdateCustomer() throws Exception {
Customer customer = customerList.get(0);
Customer customer = customerList.getFirst();
customer.setText("Updated Customer");

this.mockMvc
Expand All @@ -104,7 +104,7 @@ void shouldUpdateCustomer() throws Exception {

@Test
void shouldDeleteCustomer() throws Exception {
Customer customer = customerList.get(0);
Customer customer = customerList.getFirst();

this.mockMvc
.perform(delete("/api/customers/{id}", customer.getId()))
Expand Down
35 changes: 20 additions & 15 deletions aws-dynamodb-project/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<java.version>17</java.version>
<java.version>21</java.version>
<spring-cloud.version>2022.0.4</spring-cloud.version>
<spring-cloud-aws.version>3.0.3</spring-cloud-aws.version>
<springdoc-openapi.version>2.2.0</springdoc-openapi.version>
Expand All @@ -38,19 +38,24 @@
<junit.itReportFolder>${project.testresult.directory}/integrationTest</junit.itReportFolder>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
Expand Down Expand Up @@ -245,7 +250,7 @@
<configuration>
<java>
<googleJavaFormat>
<version>1.17.0</version>
<version>1.18.1</version>
<style>AOSP</style>
</googleJavaFormat>
<formatAnnotations />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,20 @@ public LoggingAspect(Environment env) {
}

@Pointcut(
"within(@org.springframework.stereotype.Repository *)"
+ " || within(@org.springframework.stereotype.Service *)"
+ " || within(@org.springframework.web.bind.annotation.RestController *)")
"""
within(@org.springframework.stereotype.Repository *)\
|| within(@org.springframework.stereotype.Service *)\
|| within(@org.springframework.web.bind.annotation.RestController *)\
""")
public void springBeanPointcut() {
// pointcut definition
}

@Pointcut(
"@within(com.learning.awsspring.config.logging.Loggable) || "
+ "@annotation(com.learning.awsspring.config.logging.Loggable)")
"""
@within(com.learning.awsspring.config.logging.Loggable) || \
@annotation(com.learning.awsspring.config.logging.Loggable)\
""")
public void applicationPackagePointcut() {
// pointcut definition
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void shouldFetchAllCustomers() throws Exception {

@Test
void shouldFindCustomerById() throws Exception {
Customer customer = customerList.get(0);
Customer customer = customerList.getFirst();
UUID customerId = customer.getId();

this.mockMvc
Expand All @@ -76,7 +76,7 @@ void shouldCreateNewCustomer() throws Exception {

@Test
void shouldDeleteCustomer() throws Exception {
Customer customer = customerList.get(0);
Customer customer = customerList.getFirst();

this.mockMvc
.perform(
Expand Down
Loading

0 comments on commit 6356a8c

Please sign in to comment.