【发布时间】:2018-06-12 11:34:00
【问题描述】:
我正在尝试从 Spring Boot 应用程序连接到 Twitter。 我在 application.properties 文件中添加 appId 和 appSecret 值。但我收到一个错误“'spring.social.twitter.appID' 是一个未知属性。”。
build.gradle 文件
buildscript {
ext {
springBootVersion = '2.0.2.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-
plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
group = 'masteringSpringMvc'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-thymeleaf')
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.social:spring-social-twitter:1.1.2.RELEASE')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
下面是application.properties文件
spring.thymeleaf.cache=false
spring.social.twitter.appID=apiKey
spring.social.twitter.appSecret=appSecret
【问题讨论】:
标签: spring spring-boot model-view-controller