gpt4 book ai didi

Eclipse 不更新我的 Play 框架应用程序的引用库

转载 作者:行者123 更新时间:2023-11-29 02:47:57 37 4
gpt4 key购买 nike

因为我很想在我的 Play 2 项目中使用 Elastic Search,所以我通读了 http://www.elasticsearch.org/guide/reference/java-api/和添加依赖:

构建.scala:

import sbt._
import Keys._
import PlayProject._

object ApplicationBuild extends Build {

val appName = "test"
val appVersion = "1.0-SNAPSHOT"

val appDependencies = Seq(
// Add your project dependencies here,
"mysql" % "mysql-connector-java" % "5.1.18",
"org.elasticsearch" % "elasticsearch" % "0.19.10"
)

val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(
// Add your own project settings here
resolvers += Resolver.url("GitHub Play2-elasticsearch Repository", url("http://cleverage.github.com/play2-elasticsearch/releases/"))(Resolver.ivyStylePatterns)
)
}

找到并下载依赖项,检查 Play 依赖项:

Here are the resolved dependencies of your application:

+-------------------------------------------------------------------+---------------------------------------------------------+------------------------------------+
| Module | Required by | Note |
+-------------------------------------------------------------------+---------------------------------------------------------+------------------------------------+
| org.elasticsearch:elasticsearch:0.19.10 | test:test_2.9.1:1.0-SNAPSHOT | As elasticsearch-0.19.10.jar |
+-------------------------------------------------------------------+---------------------------------------------------------+------------------------------------+
| org.apache.lucene:lucene-highlighter:3.6.1 | org.elasticsearch:elasticsearch:0.19.10 | As lucene-highlighter-3.6.1.jar |
+-------------------------------------------------------------------+---------------------------------------------------------+------------------------------------+
| org.apache.lucene:lucene-memory:3.6.1 | org.elasticsearch:elasticsearch:0.19.10 | As lucene-memory-3.6.1.jar |
| | org.apache.lucene:lucene-highlighter:3.6.1 | |
+-------------------------------------------------------------------+---------------------------------------------------------+------------------------------------+
| org.apache.lucene:lucene-queries:3.6.1 | org.elasticsearch:elasticsearch:0.19.10 | As lucene-queries-3.6.1.jar |
| | org.apache.lucene:lucene-highlighter:3.6.1 | |
+-------------------------------------------------------------------+---------------------------------------------------------+------------------------------------+
| jakarta-regexp:jakarta-regexp:1.4 | org.apache.lucene:lucene-queries:3.6.1 | |
+-------------------------------------------------------------------+---------------------------------------------------------+------------------------------------+
| org.apache.lucene:lucene-analyzers:3.6.1 | org.elasticsearch:elasticsearch:0.19.10 | As lucene-analyzers-3.6.1.jar |
+-------------------------------------------------------------------+---------------------------------------------------------+------------------------------------+
| org.apache.lucene:lucene-core:3.6.1 | org.apache.lucene:lucene-analyzers:3.6.1 | As lucene-core-3.6.1.jar |
| | org.apache.lucene:lucene-queries:3.6.1 | |
| | org.elasticsearch:elasticsearch:0.19.10 | |
| | org.apache.lucene:lucene-memory:3.6.1 | |
| | org.apache.lucene:lucene-highlighter:3.6.1 | |
+-------------------------------------------------------------------+---------------------------------------------------------+------------------------------------+
| mysql:mysql-connector-java:5.1.18 | test:test_2.9.1:1.0-SNAPSHOT | As mysql-connector-java-5.1.18.jar |
+-------------------------------------------------------------------+---------------------------------------------------------+------------------------------------+
| play:play_2.9.1:2.0.3 | test:test_2.9.1:1.0-SNAPSHOT | As play_2.9.1.jar |
...

但是在 eclipse 中我不能使用 elasticsearch,因为它找不到库。我不是甚至可以导入它。

我在这里错过了什么?

最佳答案

添加新依赖项后(即更新 Build.scala 文件后),您必须在 Play 控制台中重做 eclipsify

它将为包含新依赖项的 Eclipse 生成一个新的 .classpath 文件。

关于Eclipse 不更新我的 Play 框架应用程序的引用库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12727510/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com