idear配置gradle时,出现这样的错误:
一、dependencies
dependencies {
testImplementation(platform("org.junit.jupiter:junit-jupiter-api:5.9.1")) testImplementation("org.junit.jupiter:junit-jupiter-engine:5.9.1")
// https://mvnrepository.com/artifact/com.mysql/mysql-connector-j
implementation group: 'com.mysql', name: 'mysql-connector-j', version: '8.4.0' }
原因:
解决方法:
复制地址的时候选择Gradle(kotlin)的
dependencies {
testImplementation(platform("org.junit.jupiter:junit-jupiter-api:5.9.1"))
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.9.1")
// https://mvnrepository.com/artifact/com.mysql/mysql-connector-j
implementation("com.mysql:mysql-connector-j:8.4.0")
}
二、repositories
repositories {
mavenLocal()
maven { url "https://maven.aliyun.com/nexus/content/groups/public/" }
//mavenCentral() }
原因:语法错误
解决方法:
repositories {
mavenLocal()
// 阿里云 Maven 仓库
maven {
url = uri("https://maven.aliyun.com/nexus/content/groups/public/")
}
//mavenCentral()
}
希望对大家有所帮助!