LoginSignup
18
14

More than 1 year has passed since last update.

sbt plugin が依存する不要な dependency を exclude する

Last updated at Posted at 2014-04-18

例えばこういうのですね。実際には Jetty 9 しか使わないのに sbt の初回起動時に Jetty 6 とか Tomcat とかをダウンロードしないといけないのを抑止したい。

xsbt-web-plugin がこうなっているのは、利用する側が sbt プラグインのための libraryDepenencies を自分で追加しなくても単に build 設定の方に必要な container scope を指定するだけでよいという利点はあるのかなとは思います(推測ですが)。

ですが、ivy が jar ファイルをサチる&ダウンロードする速度は遅い上に直列化されているので、少しでも jar ファイルのダウンロードは可能な限り減らしたいのが人情です。

Twitter でぼそっとつぶやいたら、賢者の声が。

ということで

addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "0.9.0" excludeAll(
  ExclusionRule(organization = "org.mortbay.jetty"),
  ExclusionRule(organization = "org.apache.tomcat.embed")
))

のように普通に exclude/excludeAll を書くだけでよかったのでした。

18
14
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
18
14