发现要将Spring Data ElasticSearch与ElasticSearch 5.5.0一起使用,你需要使用Spring Boot的2.0.0.M2里程碑......但是,我的pom有些问题,maven无法做到这一点似乎从我指定的Maven存储库中找到了Spring Boot 2.0.0.M2里程碑。
的pom.xml:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.M2</version>
</parent>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<!-- Elasticsearch -->
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>5.5.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
<version>2.0.0.M2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
<version>2.0.0.M2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Package as an executable jar/war -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-libs-snapshot</id>
<name>Spring Snapshot Repository</name>
<url>http://repo.spring.io/libs-snapshot</url>
</repository>
<repository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</pluginRepository>
</pluginRepositories>
在做Maven时收到以下问题 - &gt;在Eclipse中更新项目:
Maven pom Loading Problem: Could not find artifact org.springframework.boot:spring-boot-maven-plugin:jar:2.0.0.M2 in spring-releases (https://repo.spring.io/libs-release) pom.xml
答案 0 :(得分:0)
对于里程碑版本,您必须使用网址let body = ["id": userID, "name": userName, "contactInfo": contactInfo, "message": message]
class func postUserFeedback(userID: Int, userName: String, contactInfo: String, message: String,completionHandler: @escaping (FeedbackResponse?) -> Void) {
let body = ["id": userID, "name": userName, "contactInfo": contactInfo, "message": message]
request(route: .userFeedback, body: body).responseObject { (response: DataResponse<FeedbackResponse>) in
response.result.ifSuccess({
completionHandler(response.result.value)
})
response.result.ifFailure {
completionHandler(nil)
}
}
}
添加里程碑存储库。