Skip to content

Commit

Permalink
Make sure the MySQL jdbc driver is included
Browse files Browse the repository at this point in the history
Add additional settings for the initial directory also works
and does not error with `./gradlw test` or `./gradlew bootRun`.
  • Loading branch information
Ruben Klink committed Apr 25, 2024
1 parent 8992b6c commit 6114331
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions complete/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

Expand Down
1 change: 1 addition & 0 deletions initial/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

Expand Down
13 changes: 13 additions & 0 deletions initial/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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"
1 change: 1 addition & 0 deletions initial/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6114331

Please sign in to comment.