2

IntelliJ(12.1)をサポートするScala(2.10)のspecs2を使用して空のsbtプロジェクトをセットアップしようとしていますが、sbt compile空のプロジェクトディレクトリでこのエラーが発生します。

% sbt compile                                                                                                                                                                                                 
Getting net.java.dev.jna jna 3.2.3 ...
:: retrieving :: org.scala-sbt#boot-jna
    confs: [default]
    1 artifacts copied, 0 already retrieved (838kB/32ms)
Getting org.scala-sbt sbt_2.9.1 0.11.3 ...
:: retrieving :: org.scala-sbt#boot-app
    confs: [default]
    37 artifacts copied, 0 already retrieved (7245kB/734ms)
Getting Scala 2.9.1 (for sbt)...
:: retrieving :: org.scala-sbt#boot-scala
    confs: [default]
    4 artifacts copied, 0 already retrieved (19939kB/402ms)
[info] Loading project definition from /Users/pathikrit/Projects/scalgos/project
[info] Set current project to scalgos (in build file:/Users/pathikrit/Projects/scalgos/)
Getting Scala 2.10.1 ...
:: retrieving :: org.scala-sbt#boot-scala
    confs: [default]
    5 artifacts copied, 0 already retrieved (24386kB/107ms)
[info] Updating {file:/Users/pathikrit/Projects/scalgos/}default-7d65e1...
[info] Resolving org.scala-lang#scala-library;2.10.1 ...
[info] Resolving org.specs2#specs2_2.10.1;1.14 ...
[warn]  module not found: org.specs2#specs2_2.10.1;1.14
[warn] ==== local: tried
[warn]   /Users/pathikrit/.ivy2/local/org.specs2/specs2_2.10.1/1.14/ivys/ivy.xml
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/org/specs2/specs2_2.10.1/1.14/specs2_2.10.1-1.14.pom
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.specs2#specs2_2.10.1;1.14: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[error] {file:/Users/pathikrit/Projects/scalgos/}default-7d65e1/*:update: sbt.ResolveException: unresolved dependency: org.specs2#specs2_2.10.1;1.14: not found
[error] Total time: 4 s, completed Mar 25, 2013 5:11:17 PM

私のbuild.sbtファイルは次のようになります。

name := "scalgos"

version := "0.0.1"

scalaVersion := "2.10.1"

libraryDependencies += "org.specs2" %% "specs2" % "1.14" % "test"

私は次のようにしてsbtをインストールしましたbrew install sbt

% brew info sbt                                                                                                                                                                                   
sbt: stable 0.12.2, devel 0.13.0-M1
http://www.scala-sbt.org
/usr/local/Cellar/sbt/0.11.3-2 (3 files, 1.1M) *
https://github.com/mxcl/homebrew/commits/master/Library/Formula/sbt.rb
==> Caveats
You can use $SBT_OPTS to pass additional JVM options to SBT.
For convenience, this can specified in `~/.sbtconfig`.

For example:
    SBT_OPTS="-XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M"

ブリューは私がsbt0.12を持っていると言いますが、私sbt --versionが得るとき:

% sbt --version                                                                                                                                                                                    
sbt launcher version 0.11.3-2

$ PROJECT_DIR / projects / plugins.sbtにこれを入れて、少なくともIntelliJファイルを生成しようとしました。

resolvers += "sbt-idea-repo" at "http://mpeltonen.github.com/maven/"

addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.2.0")

しかし、私がやったときsbt gen-idea、私はこのエラーを受け取りました:

% sbt gen-idea                                                                                                                                                                                               
[info] Loading project definition from /Users/pathikrit/Projects/scalgos/project
[info] Set current project to scalgos (in build file:/Users/pathikrit/Projects/scalgos/)
[info] Trying to create an Idea module scalgos
[info] Updating {file:/Users/pathikrit/Projects/scalgos/}default-7d65e1...
[info] Resolving org.scala-lang#scala-library;2.10.1 ...
[info] Resolving org.specs2#specs2_2.10.1;1.14 ...
[warn]  module not found: org.specs2#specs2_2.10.1;1.14
[warn] ==== local: tried
[warn]   /Users/pathikrit/.ivy2/local/org.specs2/specs2_2.10.1/1.14/ivys/ivy.xml
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/org/specs2/specs2_2.10.1/1.14/specs2_2.10.1-1.14.pom
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.specs2#specs2_2.10.1;1.14: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[error] {file:/Users/pathikrit/Projects/scalgos/}default-7d65e1/*:update: sbt.ResolveException: unresolved dependency: org.specs2#specs2_2.10.1;1.14: not found
[info] Updating {file:/Users/pathikrit/Projects/scalgos/}default-7d65e1...
[info] Resolving org.scala-lang#scala-library;2.10.1 ...
[info] Resolving org.specs2#specs2_2.10.1;1.14 ...
[warn]  module not found: org.specs2#specs2_2.10.1;1.14
[warn] ==== local: tried
[warn]   /Users/pathikrit/.ivy2/local/org.specs2/specs2_2.10.1/1.14/ivys/ivy.xml
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/org/specs2/specs2_2.10.1/1.14/specs2_2.10.1-1.14.pom
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.specs2#specs2_2.10.1;1.14: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[error] {file:/Users/pathikrit/Projects/scalgos/}default-7d65e1/*:update: sbt.ResolveException: unresolved dependency: org.specs2#specs2_2.10.1;1.14: not found
[error] Failed to obtain dependency classpath
[error] java.lang.IllegalArgumentException
[error] Use 'last' for the full log.

build.sbt誰かがScala2.10.1とsbt用のIntelliJ12.1ファイルを生成するサンプルを投稿できますか?

ここでプロジェクトをチェックインしました:https ://github.com/pathikrit/scalgos

私が間違っていることを教えてください???

4

2 に答える 2

6

私が構築したこのプロジェクトを使用して、箱から出して探しているものを提供できます

スケルトン

今夜、sbt configと最新かつ最高のライブラリ(sbt-idea1.3.0とscala2.10.1)をアップグレードする予定です。

楽しい!

于 2013-03-26T17:35:11.613 に答える
2

sbtバージョンを0.12.Xに更新し、ファイル「project / build.properties」を作成して、「sbt.version=0.12.1」を配置する必要があります。

私はあなたのリポジトリをフォークしてsbtバージョンを編集しました、それは私のマシンでうまくいくようです

https://github.com/yuanw/scalgos

于 2013-03-25T21:56:53.463 に答える