diff --git a/complete/build.gradle b/complete/build.gradle index 17890a4..9c82e68 100644 --- a/complete/build.gradle +++ b/complete/build.gradle @@ -15,6 +15,7 @@ repositories { dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-web' + runtimeOnly 'com.mysql:mysql-connector-j' testImplementation 'org.springframework.boot:spring-boot-starter-test' } diff --git a/complete/docker-compose.yml b/complete/docker-compose.yml index 859832f..ce1b7db 100644 --- a/complete/docker-compose.yml +++ b/complete/docker-compose.yml @@ -1,13 +1,14 @@ -mysql: - image: mysql - ports: - - "3306:3306" - expose: - - "3306" - environment: - - MYSQL_USER=springuser - - MYSQL_PASSWORD=ThePassword - - MYSQL_DATABASE=db_example - - MYSQL_ROOT_PASSWORD=root - volumes: - - "./conf.d:/etc/mysql/conf.d:ro" \ No newline at end of file +services: + mysql: + image: mysql + ports: + - "3306:3306" + expose: + - "3306" + environment: + - MYSQL_USER=springuser + - MYSQL_PASSWORD=ThePassword + - MYSQL_DATABASE=db_example + - MYSQL_ROOT_PASSWORD=root + volumes: + - "./conf.d:/etc/mysql/conf.d:ro" diff --git a/complete/pom.xml b/complete/pom.xml index 794ba8f..61ff223 100644 --- a/complete/pom.xml +++ b/complete/pom.xml @@ -25,7 +25,11 @@ org.springframework.boot spring-boot-starter-web - + + com.mysql + mysql-connector-j + runtime + org.springframework.boot spring-boot-starter-test diff --git a/initial/build.gradle b/initial/build.gradle index 17890a4..9c82e68 100644 --- a/initial/build.gradle +++ b/initial/build.gradle @@ -15,6 +15,7 @@ repositories { dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-web' + runtimeOnly 'com.mysql:mysql-connector-j' testImplementation 'org.springframework.boot:spring-boot-starter-test' } diff --git a/initial/docker-compose.yml b/initial/docker-compose.yml new file mode 100644 index 0000000..ce1b7db --- /dev/null +++ b/initial/docker-compose.yml @@ -0,0 +1,14 @@ +services: + mysql: + image: mysql + ports: + - "3306:3306" + expose: + - "3306" + environment: + - MYSQL_USER=springuser + - MYSQL_PASSWORD=ThePassword + - MYSQL_DATABASE=db_example + - MYSQL_ROOT_PASSWORD=root + volumes: + - "./conf.d:/etc/mysql/conf.d:ro" diff --git a/initial/pom.xml b/initial/pom.xml index 7204ccf..569ac52 100644 --- a/initial/pom.xml +++ b/initial/pom.xml @@ -25,7 +25,11 @@ org.springframework.boot spring-boot-starter-web - + + com.mysql + mysql-connector-j + runtime + org.springframework.boot spring-boot-starter-test diff --git a/initial/src/main/resources/application.properties b/initial/src/main/resources/application.properties index f502bb4..913da0a 100644 --- a/initial/src/main/resources/application.properties +++ b/initial/src/main/resources/application.properties @@ -2,3 +2,4 @@ spring.jpa.hibernate.ddl-auto=update spring.datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:3306/db_example spring.datasource.username=springuser spring.datasource.password=ThePassword +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver