/SpringBoot2SampleWithLiquibaseAndJooqAndGradle

Spring Boot 2 Sample with Liquebase and Jooq and Gradle

Primary LanguageJava

Spring Boot 2 Sample with Liquibase and Jooq and Gradle

Requirement

  • openjdk13
  • mysql 8
  • sonarqube 8.1

Install guide for Mac OS X

  • homebrew

    $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  • openjdk

    $ brew install openjdk
  • mysql

    $ brew install mysql
    $ brew services start mysql
    $ mysql
    mysql> create user if not exists sample@localhost identified by 'sample';
    mysql> create database if not exists sample;
    mysql> grant all privileges on sample.* to sample@localhost;
    mysql> flush privileges;
  • sonarqube

    $ brew install sonarqube
    $ brew services start sonarqube

How to setup project

  • init

    $ ./gradlew init
  • Liquibase diffChangeLog

    • Edit entity file(s) in package sample.model.entities

    • Generate change log file

      $ ./gradlew :model:clean :model:compileJava :model:diffChangeLog \
        -PrunList=diff \
        -x :model:update \
        -x :model:generateModelJooqSchemaSource
    • Edit db.changelog-master.yml

      ...
          - include:
              file: changelog/<new>_changelog.yml
              relativeToChangelogFile: true
  • Run

    $ ./gradlew :app:bootRun

Sonarqube

Please enjoy!