2013-06-02 12 views
5

Scalaプロジェクトにhttps://github.com/randhindi/jerksonを使用したいライブラリがあります。私は、プロジェクトのベースディレクトリにありますbuild.sbtにこのような追加される場合があります:Scalaプロジェクト(sbt)に依存関係を追加

libraryDependencies += "com.domain_example" % "library_name_test123" % "0.1.1" 

をしかし、私はすべてのそれらのデータを得るのです:ドメイン名を、ライブラリ名、バージョン?そのようなデータはありませんhttps://github.com/randhindi/jerkson

だから私はそれを使用する必要がありますか?ここで

答えて

7

は、タイプセーフで維持され、公式リポジトリですタイプセーフリポジトリへのリンクです:あなたがホストされているすべての関連プロジェクトを表示します検索ボックスに

http://repo.typesafe.com/typesafe/webapp/browserepo.html?2

タイプjerkson、リポジトリであなたは3つのコンポーネントにそれを分解することができる

com/codahale/jerkson_2.8.2/0.5.0 

次のような、パスを見ることができるはずです。

これを試してください:あなたは、最新の統合をしたい場合

libraryDependencies += "com.codahale" % "jerkson_2.8.2" % "0.5.0" 

、あなたは一般的に、第三のパラメータ

libraryDependencies += "com.codahale" % "jerkson_2.8.2" % "latest.integration" 

としてlatest.integrationを使用することができ、私は最初のMavenリポジトリをしようとするだろう。

はここでMavenのリポジトリは次のようになります。

http://mvnrepository.com/artifact/com.bealetech/metrics-statsd/2.3.0

あなたはSBTのタブを見ることができるので、これはいいです、あなたは単にあなたのコードにすることをコピーすることができます。残念ながら、私はMavenで必要なライブラリを見ませんでした。

+0

申し訳ありませんが、私はhttps://github.com/randhindi/jerksonについて正確に尋ねました –

+0

私が私の答えで述べたジャークソンプロジェクトは 'github.com/randhindi/jerkson'に関連していると思います。 'https:// github.com/randhindi/jerkson/blob/master/src/main/java/com/codahale/jerkson/JsonSnakeCase.java'からpackageステートメントを見ると、同じものだと思います。 – Mingyu

+0

しかし、このデータはどこで得られましたか? "" com.codahale "%" jerkson_2.8.2 "%" 0.5.0 "'、どこに書かれていますか? –

1

ビルド設定を調べたくない場合は、リポジトリをクローンしてpublish-localを実行してください。アーティファクト情報があります。また、ローカルのIvyリポジトリにアーティファクトを追加します。この場合:

[email protected] ~/ze $ git clone https://github.com/randhindi/jerkson.git 
Cloning into 'jerkson'... 
remote: Counting objects: 3093, done. 
remote: Compressing objects: 100% (1203/1203), done. 
remote: Total 3093 (delta 984), reused 2863 (delta 790) 
Receiving objects: 100% (3093/3093), 436.47 KiB | 177 KiB/s, done. 
Resolving deltas: 100% (984/984), done. 
[email protected] ~/ze $ cd jerkson/ 
[email protected] ~/ze/jerkson $ sbt-0.12 publish-local 
[info] Loading project definition from /home/ezh/ze/jerkson/project 
[info] Updating {file:/home/ezh/ze/jerkson/project/}default-b33f9c... 
[info] Resolving org.scala-sbt#precompiled-2_10_1;0.12.4-RC1 ... 
[info] Done updating. 
[info] Compiling 1 Scala source to /home/ezh/ze/jerkson/project/target/scala-2.9.2/sbt-0.12/classes... 
[info] Set current project to jerkson (in build file:/home/ezh/ze/jerkson/) 
[info] Updating {file:/home/ezh/ze/jerkson/}jerkson... 
[info] Packaging /home/ezh/ze/jerkson/target/scala-2.10/jerkson_2.10-0.1-SNAPSHOT-sources.jar ... 
[info] Wrote /home/ezh/ze/jerkson/target/scala-2.10/jerkson_2.10-0.1-SNAPSHOT.pom 
[info] Resolving org.scala-lang#scala-library;2.10.0 ... 
[info] Done packaging. 
[info] Resolving org.hamcrest#hamcrest-core;1.1 ... 
[info] downloading http://oss.sonatype.org/content/groups/public/com/fasterxml/jackson/core/jackson-core/2.1.1/jackson-core-2.1.1.jar ... 
[info] [SUCCESSFUL ] com.fasterxml.jackson.core#jackson-core;2.1.1!jackson-core.jar (2325ms) 
[info] downloading http://oss.sonatype.org/content/groups/public/com/fasterxml/jackson/core/jackson-databind/2.1.1/jackson-databind-2.1.1.jar ... 
[info] [SUCCESSFUL ] com.fasterxml.jackson.core#jackson-databind;2.1.1!jackson-databind.jar (2351ms) 
[info] downloading http://oss.sonatype.org/content/groups/public/org/mockito/mockito-all/1.9.0/mockito-all-1.9.0.jar ... 
[info] [SUCCESSFUL ] org.mockito#mockito-all;1.9.0!mockito-all.jar (7677ms) 
[info] downloading http://oss.sonatype.org/content/groups/public/junit/junit/4.10/junit-4.10.jar ... 
[info] [SUCCESSFUL ] junit#junit;4.10!junit.jar (1337ms) 
[info] downloading http://oss.sonatype.org/content/groups/public/com/fasterxml/jackson/core/jackson-annotations/2.1.1/jackson-annotations-2.1.1.jar ... 
[info] [SUCCESSFUL ] com.fasterxml.jackson.core#jackson-annotations;2.1.1!jackson-annotations.jar (1384ms)                     
[info] Done updating.                                           
[info] :: delivering :: jerkson#jerkson_2.10;0.1-SNAPSHOT :: 0.1-SNAPSHOT :: integration :: Sun Jun 02 09:22:19 MSK 2013                  
[info] delivering ivy file to /home/ezh/ze/jerkson/target/scala-2.10/ivy-0.1-SNAPSHOT.xml                          
[info] Compiling 77 Scala sources and 1 Java source to /home/ezh/ze/jerkson/target/scala-2.10/classes...                      
[info] Generating Scala API documentation for main sources to /home/ezh/ze/jerkson/target/scala-2.10/api...                     
[info] 'compiler-interface' not yet compiled for Scala 2.10.0. Compiling...                             
[info] Compilation completed in 10.168 s                                      
[warn] there were 51 feature warnings; re-run with -feature for details                              
model contains 312 documentable templates                                      
[warn] /home/ezh/ze/jerkson/src/main/scala/com/codahale/jerkson/util/scalax/rules/Rules.scala:67: Tag '@requires' is not recognised               
[warn] /A factory for rules that apply to a particular context.                                
[warn]^                                              
[warn] two warnings found                                          
[info] Scala API documentation generation successful.                                   
[info] Packaging /home/ezh/ze/jerkson/target/scala-2.10/jerkson_2.10-0.1-SNAPSHOT-javadoc.jar ...                        
[info] Done packaging.                                           
[warn] there were 17 deprecation warnings; re-run with -deprecation for details                            
[warn] there were 1 unchecked warnings; re-run with -unchecked for details                              
[warn] there were 51 feature warnings; re-run with -feature for details                              
[warn] three warnings found 
[warn] Error reading API from class file : java.lang.UnsupportedClassVersionError: com/codahale/jerkson/JsonSnakeCase : Unsupported major.minor version 51.0 
[info] Packaging /home/ezh/ze/jerkson/target/scala-2.10/jerkson_2.10-0.1-SNAPSHOT.jar ... 
[info] Done packaging. 
[info] published jerkson_2.10 to /home/ezh/.ivy2/local/jerkson/jerkson_2.10/0.1-SNAPSHOT/poms/jerkson_2.10.pom 
[info] published jerkson_2.10 to /home/ezh/.ivy2/local/jerkson/jerkson_2.10/0.1-SNAPSHOT/jars/jerkson_2.10.jar 
[info] published jerkson_2.10 to /home/ezh/.ivy2/local/jerkson/jerkson_2.10/0.1-SNAPSHOT/srcs/jerkson_2.10-sources.jar 
[info] published jerkson_2.10 to /home/ezh/.ivy2/local/jerkson/jerkson_2.10/0.1-SNAPSHOT/docs/jerkson_2.10-javadoc.jar 
[info] published ivy to /home/ezh/.ivy2/local/jerkson/jerkson_2.10/0.1-SNAPSHOT/ivys/ivy.xml 
[success] Total time: 56 s, completed 02.06.2013 9:22:48 

[info] published jerkson_2.10 to /home/ezh/.ivy2/local/jerkson/jerkson_2.10/0.1-SNAPSHOT/... 

あなたの場合

"jerkson" %% "jerkson" % "0.1-SNAPSHOT" 

または

"jerkson" % "jerkson_2.10" % "0.1-SNAPSHOT" 

ライブラリは、Scalaの2.10

に対する完全なログを建て

+0

これは問題ありません。しかし私はgithbuからそれを使いたいのですが、どうすればよいですか?build.sbtで何を書くべきかを知るにはどうすればいいですか? –

+0

GitHubからも使用しています。私は 'git clone https:// github.com/randhindi/jerkson.git'を行います。 「githbubからそれを使用する」とはどういう意味ですか?何か特別なことをしたいですか? – Ezhik

+0

私は - クローン化しないで意味します。 –

4

他の回答へのあなたのコメントに基づいて、github URLに直接依存関係を指定することを希望していると思います。これはasked beforeです。両方の答えが正しいので、あなたにとって有益なものになるはずです。

関連する問題