Skip to content

Commit c65ab95

Browse files
authored
chore: upgrade to java 21 (#83)
1 parent ec51797 commit c65ab95

File tree

29 files changed

+236
-210
lines changed

29 files changed

+236
-210
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
FROM openjdk:11-slim-buster
1+
FROM openjdk:21-slim-buster
22
WORKDIR /app

Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@ run-tests:
1515

1616
.PHONY: test
1717
test:
18-
@docker exec codelytv-ddd_skeleton-java ./gradlew test --warning-mode all
18+
@docker exec codelytv-ddd_example-java ./gradlew test --warning-mode all
1919

2020
.PHONY: run
2121
run:
2222
@./gradlew :run
2323

2424
.PHONY: ping-mysql
2525
ping-mysql:
26-
@docker exec codelytv-java_ddd_skeleton-mysql mysqladmin --user=root --password= --host "127.0.0.1" ping --silent
26+
@docker exec codelytv-java_ddd_example-mysql mysqladmin --user=root --password= --host "127.0.0.1" ping --silent
2727

2828
# Start the app
2929
.PHONY: start-mooc_backend
3030
start-mooc_backend:
31-
@./gradlew :run --args='mooc_backend server'
31+
@./gradlew bootRun --args='mooc_backend server'
3232

3333
.PHONY: start-backoffice_frontend
3434
start-backoffice_frontend:
35-
@./gradlew :run --args='backoffice_frontend server'
35+
@./gradlew bootRun --args='backoffice_frontend server'

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# ☕🚀 Java DDD Skeleton: Save the boilerplate in your new projects
1+
# ☕🚀 Java DDD example: Save the boilerplate in your new projects
22

33
<img src="http://codely.tv/wp-content/uploads/2016/05/cropped-logo-codelyTV.png" align="left" width="192px" height="192px"/>
44
<img align="left" width="0" height="192px" hspace="10"/>
55

66
> ⚡ Start your Java projects as fast as possible
77
88
[![CodelyTV](https://img.shields.io/badge/codely-tv-green.svg?style=flat-square)](https://codely.tv)
9-
[![CI pipeline status](https://github.com/CodelyTV/java-ddd-skeleton/workflows/CI/badge.svg)](https://github.com/CodelyTV/java-ddd-skeleton/actions)
9+
[![CI pipeline status](https://github.com/CodelyTV/java-ddd-example/workflows/CI/badge.svg)](https://github.com/CodelyTV/java-ddd-example/actions)
1010

1111
## ℹ️ Introduction
1212

@@ -18,7 +18,7 @@ Here you have the [course on CodelyTV Pro where we explain step by step all this
1818

1919
1. Install Java 11: `brew cask install corretto`
2020
2. Set it as your default JVM: `export JAVA_HOME='/Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk/Contents/Home'`
21-
3. Clone this repository: `git clone https://github.com/CodelyTV/java-ddd-skeleton`.
21+
3. Clone this repository: `git clone https://github.com/CodelyTV/java-ddd-example`.
2222
4. Bring up the Docker environment: `make up`.
2323
5. Execute some [Gradle lifecycle tasks](https://docs.gradle.org/current/userguide/java_plugin.html#lifecycle_tasks) in order to check everything is OK:
2424
1. Create [the project JAR](https://docs.gradle.org/current/userguide/java_plugin.html#sec:jar): `make build`
@@ -33,20 +33,20 @@ Here you have the [course on CodelyTV Pro where we explain step by step all this
3333

3434
### ☕ Java
3535

36-
* 📂 [Java Basic Skeleton](https://github.com/CodelyTV/java-basic-skeleton)
36+
* 📂 [Java Basic example](https://github.com/CodelyTV/java-basic-example)
3737
*[Java OOP Examples](https://github.com/CodelyTV/java-oop-examples)
3838
* 🧱 [Java SOLID Examples](https://github.com/CodelyTV/java-solid-examples)
3939
* 🥦 [Java DDD Example](https://github.com/CodelyTV/java-ddd-example)
4040

4141
### 🐘 PHP
4242

43-
* 📂 [PHP Basic Skeleton](https://github.com/CodelyTV/php-basic-skeleton)
44-
* 🎩 [PHP DDD Skeleton](https://github.com/CodelyTV/php-ddd-skeleton)
43+
* 📂 [PHP Basic example](https://github.com/CodelyTV/php-basic-example)
44+
* 🎩 [PHP DDD example](https://github.com/CodelyTV/php-ddd-example)
4545
* 🥦 [PHP DDD Example](https://github.com/CodelyTV/php-ddd-example)
4646

4747
### 🧬 Scala
4848

49-
* 📂 [Scala Basic Skeleton](https://github.com/CodelyTV/scala-basic-skeleton)
50-
*[Scala Basic Skeleton (g8 template)](https://github.com/CodelyTV/scala-basic-skeleton.g8)
49+
* 📂 [Scala Basic example](https://github.com/CodelyTV/scala-basic-example)
50+
*[Scala Basic example (g8 template)](https://github.com/CodelyTV/scala-basic-example.g8)
5151
*[Scala Examples](https://github.com/CodelyTV/scala-examples)
5252
* 🥦 [Scala DDD Example](https://github.com/CodelyTV/scala-ddd-example)

apps/main/resources/.env

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#--------------------------------#
33
MOOC_BACKEND_SERVER_PORT=8081
44
# MySql
5-
MOOC_DATABASE_HOST=codelytv-java_ddd_skeleton-mysql
5+
MOOC_DATABASE_HOST=codelytv-java_ddd_example-mysql
66
MOOC_DATABASE_PORT=3306
77
MOOC_DATABASE_NAME=mooc
88
MOOC_DATABASE_USER=root
@@ -13,20 +13,20 @@ MOOC_DATABASE_PASSWORD=
1313
BACKOFFICE_FRONTEND_SERVER_PORT=8090
1414
BACKOFFICE_BACKEND_SERVER_PORT=8091
1515
# MySql
16-
BACKOFFICE_DATABASE_HOST=codelytv-java_ddd_skeleton-mysql
16+
BACKOFFICE_DATABASE_HOST=codelytv-java_ddd_example-mysql
1717
BACKOFFICE_DATABASE_PORT=3306
1818
BACKOFFICE_DATABASE_NAME=backoffice
1919
BACKOFFICE_DATABASE_USER=root
2020
BACKOFFICE_DATABASE_PASSWORD=
2121
# Elasticsearch
22-
BACKOFFICE_ELASTICSEARCH_HOST=codelytv-java_ddd_skeleton-elasticsearch
22+
BACKOFFICE_ELASTICSEARCH_HOST=codelytv-java_ddd_example-elasticsearch
2323
BACKOFFICE_ELASTICSEARCH_PORT=9200
2424
BACKOFFICE_ELASTICSEARCH_INDEX_PREFIX=backoffice
2525

2626
# COMMON #
2727
#--------------------------------#
2828
# RabbitMQ
29-
RABBITMQ_HOST=codelytv-java_ddd_skeleton-rabbitmq
29+
RABBITMQ_HOST=codelytv-java_ddd_example-rabbitmq
3030
RABBITMQ_PORT=5672
3131
RABBITMQ_LOGIN=codelytv
3232
RABBITMQ_PASSWORD=c0d3ly

apps/main/resources/log4j2.properties

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name = CodelyTvJavaDddSkeleton
1+
name = CodelyTvJavaDddExample
22
property.filename = logs
33
appenders = console, file
44

@@ -16,15 +16,15 @@ appender.console.logstash.stackTraceEnabled = true
1616

1717
appender.file.type = File
1818
appender.file.name = LOGFILE
19-
appender.file.fileName = var/log/java-ddd-skeleton.log
19+
appender.file.fileName = var/log/java-ddd-example.log
2020
appender.file.logstash.type = LogstashLayout
2121
appender.file.logstash.dateTimeFormatPattern = yyyy-MM-dd'T'HH:mm:ss.SSSZZZ
2222
appender.file.logstash.eventTemplateUri = classpath:LogstashJsonEventLayoutV1.json
2323
appender.file.logstash.prettyPrintEnabled = false
2424
appender.file.logstash.stackTraceEnabled = true
2525

2626
loggers = file
27-
logger.file.name = tv.codely.java_ddd_skeleton
27+
logger.file.name = tv.codely.java_ddd_example
2828
logger.file.level = info
2929
logger.file.appenderRefs = file
3030
logger.file.appenderRef.file.ref = LOGFILE

apps/main/tv/codely/apps/backoffice/backend/middleware/BasicHttpAuthMiddleware.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import tv.codely.shared.domain.bus.command.CommandBus;
77
import tv.codely.shared.domain.bus.command.CommandHandlerExecutionError;
88

9-
import javax.servlet.*;
10-
import javax.servlet.http.HttpServletRequest;
11-
import javax.servlet.http.HttpServletResponse;
9+
import jakarta.servlet.*;
10+
import jakarta.servlet.http.HttpServletRequest;
11+
import jakarta.servlet.http.HttpServletResponse;
1212
import java.io.IOException;
1313
import java.util.Base64;
1414

apps/main/tv/codely/apps/mooc/backend/config/MoocBackendServerConfiguration.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public MoocBackendServerConfiguration(RequestMappingHandlerMapping mapping) {
1515
}
1616

1717
@Bean
18-
public FilterRegistrationBean<ApiExceptionMiddleware> basicHttpAuthMiddleware() {
18+
public FilterRegistrationBean<ApiExceptionMiddleware> apiExceptionMiddleware() {
1919
FilterRegistrationBean<ApiExceptionMiddleware> registrationBean = new FilterRegistrationBean<>();
2020

2121
registrationBean.setFilter(new ApiExceptionMiddleware(mapping));

apps/test/resources/log4j2.properties

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name = CodelyTvJavaDddSkeleton
1+
name = CodelyTvJavaDddExample
22
property.filename = logs
33
appenders = console, file
44

@@ -15,15 +15,15 @@ appender.console.filter.threshold.level = info
1515

1616
appender.file.type = File
1717
appender.file.name = LOGFILE
18-
appender.file.fileName = var/log/java-ddd-skeleton-test.log
18+
appender.file.fileName = var/log/java-ddd-example-test.log
1919
appender.file.logstash.type = LogstashLayout
2020
appender.file.logstash.dateTimeFormatPattern = yyyy-MM-dd'T'HH:mm:ss.SSSZZZ
2121
appender.file.logstash.eventTemplateUri = classpath:LogstashJsonEventLayoutV1.json
2222
appender.file.logstash.prettyPrintEnabled = false
2323
appender.file.logstash.stackTraceEnabled = true
2424

2525
loggers = file
26-
logger.file.name = tv.codely.java_ddd_skeleton
26+
logger.file.name = tv.codely.java_ddd_example
2727
logger.file.level = info
2828
logger.file.appenderRefs = file
2929
logger.file.appenderRef.file.ref = LOGFILE

apps/test/tv/codely/apps/ApplicationTestCase.java

-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
package tv.codely.apps;
22

3-
import org.junit.runner.RunWith;
43
import org.springframework.beans.factory.annotation.Autowired;
54
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
65
import org.springframework.boot.test.context.SpringBootTest;
76
import org.springframework.http.HttpHeaders;
87
import org.springframework.http.HttpMethod;
9-
import org.springframework.test.context.junit4.SpringRunner;
108
import org.springframework.test.web.servlet.MockMvc;
119
import org.springframework.test.web.servlet.ResultMatcher;
1210
import tv.codely.shared.domain.bus.event.DomainEvent;
@@ -20,7 +18,6 @@
2018
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
2119
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
2220

23-
@RunWith(SpringRunner.class)
2421
@SpringBootTest
2522
@AutoConfigureMockMvc
2623
public abstract class ApplicationTestCase {

0 commit comments

Comments
 (0)