【エラー】Could not find mysql:mysql-connector-java:について
Java初学者です。
現在、IntelliJ IDEA CEにてアプリケーション開発の学習をしているのですが、
MySQLと連携するため、ライブラリを導入する記述をし更新、実行したところ以下のエラーが出てしまいました。
Execution failed for task ':FirstappApplication.main()'.
> Could not resolve all files for configuration ':runtimeClasspath'.
> Could not find mysql:mysql-connector-java:.
Required by:
project :
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
該当するソースコード
build.gradle
plugins {
id 'java'
id 'org.springframework.boot' version '2.7.9'
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
}
group = 'in.techcamp'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.2'
runtimeOnly 'mysql:mysql-connector-java'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
}
tasks.named('test') {
useJUnitPlatform()
}
調べてみましたが、該当する内容が見つからず手詰まりの状態です。
ご教示いただければ幸いです。
0 likes