sbtプロジェクトで別のsbtモジュールをインポートする方法
自分が作った以下のスパムフィルターを別のsbtプロジェクトでも使用したいと思ってるのですが、intellijでこれをモジュールとして追加して依存関係を設定するとエディタ上ではちゃんと使えるように見えるのですが、
https://github.com/lamrongol/JapaneseTwitterSpamFilter
実際に実行しようとすると以下の様なエラーが出ます。
Error:scalac: missing or invalid dependency detected while loading class file 'JapaneseSpamFilter.class'.
Could not access term apache in package org,
because it (or its dependencies) are missing. Check your build definition for
missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
A full rebuild may help if 'JapaneseSpamFilter.class' was compiled against an incompatible version of org.
Error:scalac: missing or invalid dependency detected while loading class file 'JapaneseSpamFilter.class'.
Could not access term spark in value org.apache,
because it (or its dependencies) are missing. Check your build definition for
missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
A full rebuild may help if 'JapaneseSpamFilter.class' was compiled against an incompatible version of org.apache.
Error:scalac: missing or invalid dependency detected while loading class file 'JapaneseSpamFilter.class'.
Could not access term mllib in value org.spark,
because it (or its dependencies) are missing. Check your build definition for
missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
A full rebuild may help if 'JapaneseSpamFilter.class' was compiled against an incompatible version of org.spark.
Error:scalac: missing or invalid dependency detected while loading class file 'JapaneseSpamFilter.class'.
Could not access term atilika in package com,
because it (or its dependencies) are missing. Check your build definition for
missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
A full rebuild may help if 'JapaneseSpamFilter.class' was compiled against an incompatible version of com.
Error:scalac: missing or invalid dependency detected while loading class file 'JapaneseSpamFilter.class'.
Could not access term kuromoji in value com.atilika,
because it (or its dependencies) are missing. Check your build definition for
missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
A full rebuild may help if 'JapaneseSpamFilter.class' was compiled against an incompatible version of com.atilika.
どうやらスパムフィルターで使用しているKuromojiなどのライブラリが存在しないと言っているようなのですが、スパムフィルターのbuild.sbtで記述したライブラリをインポート先でもまた書かなければいけないのでしょうか。
依存ライブラリも含めてインポートするにはどうしたら良いでしょうか?
追記:
scala - How to reference external sbt project from another sbt project? - Stack Overflowを参考にprojectフォルダ内にBuild.scalaファイルを作って以下のように記述したのですが、
object ScalaSampleBuild extends Build {
lazy val root = Project(
id = "TestScalaProject", //Your project name
base = file(".")
).dependsOn(spamFilterProject)
//lazy val spamFilterProject = ProjectRef(file("..\\..\\..\\TwitterAnalysis\\SpamFilter"), "SpamFilter")
lazy val spamFilterProject = RootProject(file("C:\\workspaces\\TwitterAnalysis\\SpamFilter"))
}
今度は以下の様なエラーが出てできませんでした。
Error:Unresolved dependencies:
default#spamfilter_2.10;1.0: not found
See complete log in C:\Users\admin\.IdeaIC15\system\log\sbt.last.log