Olá, eu venho fazendo o curso usando o kotlin gradle e agora está dando um erro que aponta pra referência do driver no application.yml
, mas não estou conseguindo resolver:
java.lang.ClassNotFoundException: org.gradle.internal.impldep.org.h2.Driver
application.yml:
spring:
datasource:
driverClassName: org.gradle.internal.impldep.org.h2.Driver
url: jdbc:h2:mem:forum
username: sa
password:
jpa:
database-platform: org.hibernate.dialect.H2Dialect
defer-datasource-initialization: false
build.gradle.kts:
plugins {
kotlin("jvm") version "1.9.25"
kotlin("plugin.spring") version "1.9.25"
kotlin("plugin.noarg") version "2.0.20"
kotlin("plugin.jpa") version "2.0.20"
id("org.springframework.boot") version "3.3.3"
id("io.spring.dependency-management") version "1.1.6"
}
group = "br.com.alura"
version = "0.0.1-SNAPSHOT"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
repositories {
mavenCentral()
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("org.springframework.boot:spring-boot-starter-web")
testImplementation("com.h2database:h2:2.2.220")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.jetbrains.kotlin:kotlin-reflect")
developmentOnly("org.springframework.boot:spring-boot-devtools")
developmentOnly("org.springframework.data:spring-data-jpa")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
implementation("org.springframework.boot:spring-boot-starter-data-jpa:3.3.3")
implementation("org.springframework.boot:spring-boot-starter-web:3.3.3")
}
kotlin {
compilerOptions {
freeCompilerArgs.addAll("-Xjsr305=strict")
}
}
tasks.withType<Test> {
useJUnitPlatform()
}