Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Commit ca8054b

Browse files
authored
Merge pull request #1 from CodelyTV/java-11
Remove support for Java 8, update dependencies, improve CI & ReadMe
2 parents 92a3263 + 3e8bc3c commit ca8054b

File tree

8 files changed

+121
-123
lines changed

8 files changed

+121
-123
lines changed

.travis.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
language: java
22

33
jdk:
4-
- openjdk8
54
- openjdk11
6-
- oraclejdk11
75

86
os:
97
- linux
10-
- osx
118

129
before_cache:
1310
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
@@ -18,11 +15,6 @@ cache:
1815
- $HOME/.gradle/caches/
1916
- $HOME/.gradle/wrapper/
2017

21-
# Run commands before TravisCI install step only in some cases
22-
# More info: https://docs.travis-ci.com/user/multi-os/#example-multi-os-build-matrix
23-
before_install:
24-
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
25-
2618
# Override default install process on TravisCI
2719
# Avoid default `gradlew assemble` execution. Be explicit about it on the `script` section.
2820
# More info: https://github.com/travis-ci/travis-ci/issues/8667
@@ -32,4 +24,4 @@ install: true
3224
# Compile before running the tests in order to easily check which task could be failing.
3325
script:
3426
- ./gradlew assemble --warning-mode all
35-
- ./gradlew check --warning-mode all
27+
- ./gradlew check --warning-mode all

README.md

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,35 @@
1-
# Java Bootstrap (base / project skeleton)
1+
# ☕🎯 Hexagonal Architecture + DDD + CQRS Java example with SpringBoot
22

3-
## Introduction
3+
<img src="http://codely.tv/wp-content/uploads/2016/05/cropped-logo-codelyTV.png" align="left" width="192px" height="192px"/>
4+
<img align="left" width="0" height="192px" hspace="10"/>
45

5-
This is a repository intended to serve as a starting point if you want to bootstrap a project in Java 8 with JUnit 5.2 and Gradle 4.6.
6+
> You can do awesome stuff with Java 🙂
67
7-
## How To Start
8+
[![CodelyTV](https://img.shields.io/badge/codely-tv-green.svg?style=flat-square)](https://codely.tv)
9+
[![Build Status](https://travis-ci.com/CodelyTV/cqrs-ddd-java-example.svg?branch=master)](https://travis-ci.com/CodelyTV/cqrs-ddd-java-example)
810

9-
1. Install Java 8
10-
2. Clone this repository `git clone https://github.com/CodelyTV/java-bootstrap`.
11-
3. Run the tests with `./gradlew test`
11+
Implementation example of a Java application following Domain-Driven Design (DDD) and Command Query Responsibility Segregation (CQRS) principles, keeping the code as simple as possible.
12+
13+
Take a look, play and have fun with it!
14+
15+
## 🚀 Environment setup
16+
17+
1. Install Java: `brew cask install java`
18+
2. Clone this repository: `git clone https://github.com/CodelyTV/cqrs-ddd-java-example`
19+
3. Execute some [Gradle lifecycle tasks](https://docs.gradle.org/current/userguide/java_plugin.html#lifecycle_tasks) in order to check everything is OK:
20+
1. Create [the project JAR](https://docs.gradle.org/current/userguide/java_plugin.html#sec:jar) and other project artifacts:
21+
`./gradlew assemble --warning-mode all`
22+
2. Run the tests and plugins verification tasks:
23+
`./gradlew check --warning-mode all`
1224
4. Start developing!
25+
26+
## 🤔 How to update dependencies
27+
28+
* Gradle (current version: 5.1.1 - [releases](https://gradle.org/releases/)):
29+
`./gradlew wrapper --gradle-version=5.1.1 --distribution-type=bin` or modifying the [gradle-wrapper.properties](gradle/wrapper/gradle-wrapper.properties#L3)
30+
* JUnit (current version: 5.3.2 - [releases](https://junit.org/junit5/docs/snapshot/release-notes/index.html)):
31+
[`build.gradle:11`](build.gradle#L11-L12)
32+
33+
## 🤝 Contributing
34+
35+
There are a lot of missing things (add swagger/OpenAPI, improve documentation...), feel free to add them if you want!

bitbucket-pipelines.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

build.gradle

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
apply plugin: 'java'
22

3-
sourceCompatibility = 1.8
3+
sourceCompatibility = 1.11
4+
targetCompatibility = 1.11
45

56
repositories {
67
mavenCentral()
78
}
89

910
dependencies {
10-
testCompile('org.junit.jupiter:junit-jupiter-api:5.2.0')
11-
testRuntime('org.junit.jupiter:junit-jupiter-engine:5.2.0')
11+
testCompile('org.junit.jupiter:junit-jupiter-api:5.3.2')
12+
testRuntime('org.junit.jupiter:junit-jupiter-engine:5.3.2')
1213
}
1314

1415
test {
@@ -21,9 +22,4 @@ test {
2122
reports {
2223
html.enabled = true
2324
}
24-
}
25-
26-
task wrapper(type: Wrapper) {
27-
description = 'Generates gradlew[.bat] scripts'
28-
gradleVersion = '4.6'
2925
}

gradle/wrapper/gradle-wrapper.jar

1.8 KB
Binary file not shown.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Fri Jun 01 07:06:45 CEST 2018
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip

gradlew

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,4 @@ if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169169
cd "$(dirname "$0")"
170170
fi
171171

172-
exec "$JAVACMD" "$@"
172+
exec "$JAVACMD" "$@"

gradlew.bat

Lines changed: 84 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,84 @@
1-
@if "%DEBUG%" == "" @echo off
2-
@rem ##########################################################################
3-
@rem
4-
@rem Gradle startup script for Windows
5-
@rem
6-
@rem ##########################################################################
7-
8-
@rem Set local scope for the variables with windows NT shell
9-
if "%OS%"=="Windows_NT" setlocal
10-
11-
set DIRNAME=%~dp0
12-
if "%DIRNAME%" == "" set DIRNAME=.
13-
set APP_BASE_NAME=%~n0
14-
set APP_HOME=%DIRNAME%
15-
16-
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17-
set DEFAULT_JVM_OPTS=
18-
19-
@rem Find java.exe
20-
if defined JAVA_HOME goto findJavaFromJavaHome
21-
22-
set JAVA_EXE=java.exe
23-
%JAVA_EXE% -version >NUL 2>&1
24-
if "%ERRORLEVEL%" == "0" goto init
25-
26-
echo.
27-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28-
echo.
29-
echo Please set the JAVA_HOME variable in your environment to match the
30-
echo location of your Java installation.
31-
32-
goto fail
33-
34-
:findJavaFromJavaHome
35-
set JAVA_HOME=%JAVA_HOME:"=%
36-
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37-
38-
if exist "%JAVA_EXE%" goto init
39-
40-
echo.
41-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42-
echo.
43-
echo Please set the JAVA_HOME variable in your environment to match the
44-
echo location of your Java installation.
45-
46-
goto fail
47-
48-
:init
49-
@rem Get command-line arguments, handling Windows variants
50-
51-
if not "%OS%" == "Windows_NT" goto win9xME_args
52-
53-
:win9xME_args
54-
@rem Slurp the command line arguments.
55-
set CMD_LINE_ARGS=
56-
set _SKIP=2
57-
58-
:win9xME_args_slurp
59-
if "x%~1" == "x" goto execute
60-
61-
set CMD_LINE_ARGS=%*
62-
63-
:execute
64-
@rem Setup the command line
65-
66-
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67-
68-
@rem Execute Gradle
69-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70-
71-
:end
72-
@rem End local scope for the variables with windows NT shell
73-
if "%ERRORLEVEL%"=="0" goto mainEnd
74-
75-
:fail
76-
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77-
rem the _cmd.exe /c_ return code!
78-
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79-
exit /b 1
80-
81-
:mainEnd
82-
if "%OS%"=="Windows_NT" endlocal
83-
84-
:omega
1+
@if "%DEBUG%" == "" @echo off
2+
@rem ##########################################################################
3+
@rem
4+
@rem Gradle startup script for Windows
5+
@rem
6+
@rem ##########################################################################
7+
8+
@rem Set local scope for the variables with windows NT shell
9+
if "%OS%"=="Windows_NT" setlocal
10+
11+
set DIRNAME=%~dp0
12+
if "%DIRNAME%" == "" set DIRNAME=.
13+
set APP_BASE_NAME=%~n0
14+
set APP_HOME=%DIRNAME%
15+
16+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17+
set DEFAULT_JVM_OPTS=
18+
19+
@rem Find java.exe
20+
if defined JAVA_HOME goto findJavaFromJavaHome
21+
22+
set JAVA_EXE=java.exe
23+
%JAVA_EXE% -version >NUL 2>&1
24+
if "%ERRORLEVEL%" == "0" goto init
25+
26+
echo.
27+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28+
echo.
29+
echo Please set the JAVA_HOME variable in your environment to match the
30+
echo location of your Java installation.
31+
32+
goto fail
33+
34+
:findJavaFromJavaHome
35+
set JAVA_HOME=%JAVA_HOME:"=%
36+
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37+
38+
if exist "%JAVA_EXE%" goto init
39+
40+
echo.
41+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42+
echo.
43+
echo Please set the JAVA_HOME variable in your environment to match the
44+
echo location of your Java installation.
45+
46+
goto fail
47+
48+
:init
49+
@rem Get command-line arguments, handling Windows variants
50+
51+
if not "%OS%" == "Windows_NT" goto win9xME_args
52+
53+
:win9xME_args
54+
@rem Slurp the command line arguments.
55+
set CMD_LINE_ARGS=
56+
set _SKIP=2
57+
58+
:win9xME_args_slurp
59+
if "x%~1" == "x" goto execute
60+
61+
set CMD_LINE_ARGS=%*
62+
63+
:execute
64+
@rem Setup the command line
65+
66+
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67+
68+
@rem Execute Gradle
69+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70+
71+
:end
72+
@rem End local scope for the variables with windows NT shell
73+
if "%ERRORLEVEL%"=="0" goto mainEnd
74+
75+
:fail
76+
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77+
rem the _cmd.exe /c_ return code!
78+
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79+
exit /b 1
80+
81+
:mainEnd
82+
if "%OS%"=="Windows_NT" endlocal
83+
84+
:omega

0 commit comments

Comments
 (0)