2012-03-02 34 views
3

我正在使用使用SBT的Play 2框架,並試圖在我的項目中包含Lucene夜間罐子。我已將以下內容添加到我的plugins.sbt中:在Play 2 SBT項目中包含Lucene夜間罐子

resolvers ++= Seq(
    DefaultMavenRepository, 
    Resolver.url("Play", url("http://download.playframework.org/ivy-releases/"))(Resolver.ivyStylePatterns), 
    "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/", 
    "Lucence Snapshot Repository" at "https://builds.apache.org/job/Lucene-Solr-Maven-trunk/lastSuccessfulBuild/artifact/maven_artifacts/" 
) 

但是,它無法找到該jar。它似乎甚至沒有檢查新的存儲庫:

[warn] module not found: org.apache.lucene#lucene-analyzers-common;4.0-SNAPSHOT  
[warn] ==== local: tried 
[warn] /usr/local/users/bmccann/Play20/framework/../repository/local/org.apache.lucene/lucene- analyzers-common/4.0-SNAPSHOT/ivys/ivy.xml 
[warn] ==== Typesafe Releases Repository: tried 
[warn] http://repo.typesafe.com/typesafe/releases/org/apache/lucene/lucene-analyzers-common/4.0-SNAPSHOT/lucene-analyzers-common-4.0-SNAPSHOT.pom 
[warn] ==== Typesafe Snapshots Repository: tried 
[warn] http://repo.typesafe.com/typesafe/snapshots/org/apache/lucene/lucene-analyzers-common/4.0-SNAPSHOT/lucene-analyzers-common-4.0-SNAPSHOT.pom 
[warn] ==== public: tried 
[warn] http://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common/4.0-SNAPSHOT/lucene-analyzers-common-4.0-SNAPSHOT.pom 
[warn] ==== Scala-Tools Maven2 Repository: tried 
[warn] http://scala-tools.org/repo-releases/org/apache/lucene/lucene-analyzers-common/4.0-SNAPSHOT/lucene-analyzers-common-4.0-SNAPSHOT.pom 
[warn] ::::::::::::::::::::::::::::::::::::::::::::::       
[warn] ::   UNRESOLVED DEPENDENCIES   :: 
[warn] :::::::::::::::::::::::::::::::::::::::::::::: 
[warn] :: org.apache.lucene#lucene-analyzers-common;4.0-SNAPSHOT: not found 
[warn] :::::::::::::::::::::::::::::::::::::::::::::: 

是否SBT做這些回購,我需要重置一些緩存?它可以不處理https回購?我無法弄清楚這裏發生了什麼。任何人都可以將jar包括到他們的項目中嗎?

回答

0

確定的URL

https://builds.apache.org/job/Lucene-Solr-Maven-trunk/lastSuccessfulBuild/artifact/maven_artifacts/

爲Maven倉庫正確的網址是什麼?當我在瀏覽器中打開它時,我看到一個Jenkins實例,它看上去並不正確...

檢查周圍,我只能找到穩定版本的回收站,所以我有這種感覺,你需要手動如果你想要的話,下載每晚構建一個。不過,我可能錯過了正確的存儲庫。

+0

他們詹金斯建的,但我敢肯定它仍然是一個Maven倉庫。它的目錄結構與Maven所需的匹配,POM文件在那裏,等等。只要符合要求,您就可以以任何形式託管Maven回購。例如,我已經將它們看作是在該結構中對somone的googlecode或GitHub進行了檢查的jar。以下是一些文檔,指每晚作爲有效的Maven回購: https://svn.apache.org/repos/asf/lucene/dev/trunk/dev-tools/maven/README.maven http: //wiki.apache.org/solr/NightlyBuilds – 2012-03-02 10:43:23

0

我管理,加入這個到Build.scala文件添加lucene的依賴性:

val appDependencies = Seq(
.... 
"org.apache.lucene" % "lucene-core" % "3.0.0" 
) 

希望它可以幫助..

+0

謝謝。我試圖找出它的Lucene 4雖然=) – 2012-03-29 19:18:44

0

按照readme您發佈。這爲我工作:

resolvers += "Apache Snapshots" at "http://repository.apache.org/snapshots/" 

libraryDependencies += "org.apache.lucene" % "lucene-analyzers-common" % "4.0-SNAPSHOT" 

下面是輸出

> compile 
[info] Updating {file:/Users/eed3si9n/work/helloworld/}app... 
[info] Resolving org.fusesource.jansi#jansi;1.4 ... 
[info] downloading http://repository.apache.org/snapshots/org/apache/lucene/lucene-analyzers-common/4.0-SNAPSHOT/lucene-analyzers-common-4.0-20120918.141722-107.jar ... 
[info] [SUCCESSFUL ] org.apache.lucene#lucene-analyzers-common;4.0-SNAPSHOT!lucene-analyzers-common.jar (3647ms) 
[info] downloading http://repository.apache.org/snapshots/org/apache/lucene/lucene-core/4.0-SNAPSHOT/lucene-core-4.0-20120918.141624-107.jar ... 
[info] [SUCCESSFUL ] org.apache.lucene#lucene-core;4.0-SNAPSHOT!lucene-core.jar (4295ms) 
[info] Done updating. 
相關問題