0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Mavenプロジェクトの成果物をsbtで使う時

Posted at

ちょっと困ったのでメモ程度だけど。

mvn の世界

  • いい感じで pom.xml を作成する
  • 何も考えず、mvn clean install する

この時、sbt の世界は考えなくてよい。これで、

$ mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building hogemogeo-special 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.4/maven-install-plugin-2.4.pom
<略>
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.784s
[INFO] Finished at: Tue Apr 19 14:18:40 JST 2016
[INFO] Final Memory: 15M/206M
[INFO] ------------------------------------------------------------------------

とか表示され、~/.m2/repository の下に色々できる。

sbt の世界

  • ivy の世界から逸脱しない(軸足は ivy)
  • build.sbt の dependency を解決する

こんな感じ。

resolvers += "Local Maven Repository" at "/home/hogemogeo/.m2/repository"
libraryDependencies += "com.ufufu.fugaufga" % "hogemogeo-special" % "1.0-SNAPSHOT"

結論

maven だ! ( ゚Д゚)ウヒョー! と身構えていたら、単なる外部ライブラリの参照解決じゃん。
でも、mvn clean install からの流れが sbt publish-local 的にできるので、成果があったことにしておきます。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?