- Java 11
- Eclipse
- Gradle (./gradlew)
- NodeJs (https://github.com/creationix/nvm)
We use Gradle as our build system. All commands listed here follow the pattern gradle <task>'
.
If Gradle is not installed on your system you can use sh gradlew <task>
instead.
gradlew tasks
- list all tasksgradlew eclipse
- setup eclipse filesgradlew run
- start server for UI developmentgradlew bootRun
- start server for development (refreshes static resources)gradlew test
- execute unit tests (open report withopen build/reports/tests/index.html
- for executing single test add
-Dtest.single=ExampleMainTest
- for running tests on mysql add
-Pmysql
gradlew clean
- clean the project
Setup with the Gradle Integration for Eclipse plugin.
Setup by using the gradle eclipse plugin
Select "Import..." -> "Gradle Project" then build the model and import the plugins you need.
Additional stuff:
Make sure you have the following classes included for static import:
- lombok
- org.assertj.core.api.Assertions
- org.mockito.Matchers
- com.jayway.restassured.RestAssured
(In Eclipse under Preferences/Java/Editor/Content Assist/Favorites)
- Create fresh databases:
drop database weplantaforest; create database weplantaforest;
drop database weplantaforest_test; create database weplantaforest_test;
- Run tests with MySql from Gradle by adding the flag
-Pmysql
, e.g.gradle test -Pmysql
- Run tests with MySql from Eclipse by either:
- Change existing annotation
@IntegrationTest({ "spring.profiles.active=test" })
into@IntegrationTest({ "spring.profiles.active=test,mysql-test" })
- OR switch the included profiles in
application-test.properties
- Change existing MySql Schema (managed by Flyway)
- Add to the latest (unreleased)
src/main/resources/db/migration/V*.sql
script - OR create a new script, e.g.
src/main/resources/db/migration/V1_2__descriptionOfMyChange.sql
./gradlew user:bootRun
./gradlew article-manager:bootRun
ui/node_modules/.bin/http-server --cors ui/client-react/
cd ui; webpack -w
Now you can open a browser window with:
open http://localhost:8080
P: I get an error while starting a gradle task.
Could not open terminal for stdout: could not get termcap entry
A: Paste following command in current before executing gradle
export GRADLE_OPTS=-Dorg.gradle.native=false