我正在尝试按照此在 IntelliJ 中使用 Gradle 设置 AWS Polly Java SDK 。我已经使用 ,创建了一个简单的 Spring Boot 应用程序spring intializr
,因此我将教程中指定的项目添加到我的build.gradle
文件中。尝试导入时
import com.amazonaws.services.polly.AmazonPollyClient
IntelliJ 无法解析 name polly
。
这是我的完整build.gradle
文件
buildscript {
ext {
springBootVersion = '2.0.4.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath "io.spring.gradle:dependency-management-plugin:1.0.3.RELEASE"
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
group = 'io.ai.vivid'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencyManagement {
imports {
mavenBom 'com.amazonaws:aws-java-sdk-bom:1.11.228'
}
}
dependencies {
compile('org.springframework.boot:spring-boot-starter')
testCompile('org.springframework.boot:spring-boot-starter-test')
compile 'com.amazonaws:aws-java-sdk-s3'
testCompile group: 'junit', name: 'junit', version: '4.11'
}
IntelliJ 也抱怨它无法解析manvenBom
我的build.gradle
. 我已经尝试过 SO 解决方案,例如使缓存/重启无效,但无法解决问题。
我使用您的build.gradle
文件来复制该问题,并且在对文件进行AmazonPollyClient
以下更改后能够导入dependencies
dependencies {
compile 'com.amazonaws:aws-java-sdk-s3'
compile group: 'com.amazonaws', name: 'aws-java-sdk-polly', version: '1.11.67'
Gradle 版本使用 4.8
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句