B. Configure project
Git Link
1. Configure the pom.xml (Project Object Model)
- Import spring parent
- Spring dependency
- H2 DB memory dependency
- Liquibase dependency
- Create directory C:/dev_tutorial on windows or /home/dev_tutorial on Linux
- Add properties file on the project:
- Config home directory (on application-default.properties file) :
- Add : home.directory=c:/dev_tutorial
- Config data source (on application-default.properties file) :
- spring.challenge.datasource.jdbc-url=jdbc:h2:file:${home.directory}/db/springLiquiBaseTutorial;AUTO_SERVER=TRUE
- spring.challenge.datasource.username=sa
- spring.challenge.datasource.password=sa
- Liquibase script to create tables :
3. Configuration class (application and datasource)
Create a java class to configure the application, to run the batch and import the properties file on it.
- @See : /spring-boot-and-liquibase-tutorial/src/main/java/com/java/spring/SpringAndLiquiBaseApplication.java
After that create a class to configure the datasaource access wich use the Spring Data JPA.
Comments
Post a Comment