Running environment need to be setup before build or test START-DB.
- Please follow Docker Setup and confirm
- init mysql schema
mvn test exec:java -f start-db-test/start-db-test-embedded-mysql/pom.xml
then
mvn clean package
run successfully.
START-DB builds using Java 8. When importing into IntelliJ you will need to define an appropriate SDK.or more details on defining an SDK in IntelliJ please refer to their documentation.
You can import the START-DB project into IntelliJ IDEA via:
- Select File > Open
- In the subsequent dialog navigate to the root
pom.xml
file - In the subsequent dialog select Open as Project
You can install Checkstyle plugin to check the START-DB code.
- Open File > Settings> Tools > CheckStyle
- Select CheckStyle version
9.3
- Import CheckStyle file
conventions/checkstyle.xml
- Click "OK"
START-DB code is automatically formatted with spotless, backed by the Eclipse formatter. You can do the same in IntelliJ with the Eclipse Code Formatter so that you can apply the correct formatting directly in your IDE.
Java Code Style
- Open File > Settings/Preferences > Plugins
- Install Adapter for Eclipse Code Formatter from marketplace
- Open File > Settings/Preferences > Adapter for Eclipse Code Formatter
- Click "Use the Eclipse Code Formatter"
- Use default "Boundled Eclipse"
- Under "Eclipse formatter config", select "Eclipse workspace/project folder or config file"
- Click "Browse", and navigate to the file
conventions/eclipse-formatter.xml
- IMPORTANT - make sure "Optimize Imports" is NOT selected.
- Click "OK"
Scala Code Style
- Open File > Settings/Preferences > Code Style > Scala
- Change Formatter to
scalafmt
- Set Configguration to file
conventions/scalafmt.conf
- Click "OK"
Formatting will be triggered when running command mvn package
. Or you can do format only with
command mvn spotless:apply
.