SBT / Good way to override a plugin's setting

。_饼干妹妹 提交于 2020-01-07 02:22:12

问题


I want to change the aspectj version used by this plugin (line 59).
Indeed, I want to use aspectj version 1.8.0 and not 1.7.3.
I sent a message to the creator but I'm stuck until he could answer since I've got a Spring-Data component that depends on 1.8.0.

The current plugin's setting is:

lazy val aspectjSettings: Seq[Setting[_]] = inConfig(Aspectj)(defaultAspectjSettings) ++ aspectjDependencySettings

  def defaultAspectjSettings = Seq(
    aspectjVersion := "1.7.3",
  .......

Mu current SBT for my own project starts as following:

val webApp = play.Project(appName, appVersion, appDependencies)
    .settings(aspectjSettings: _*)

What is a good way to "override" aspectjVersion := "1.7.3" by aspectjVersion := "1.8.0"?

I tried this, but doesn't seem to work.

.settings(Seq(aspectjVersion := "1.8.0") ++ aspectjSettings.filterNot(_.key.key.label == "aspectjVersion"): _*)

I still have this error:

warning bad version number found in /Developpements/play-2.2.3/repository/cache/org.aspectj/aspectjrt/jars/aspectjrt-1.8.0.jar expected 1.7.3 found 1.8.0

回答1:


If you look at line 56 the settings are defined with

 inConfig(Aspectj)(defaultAspectjSettings) ...

which means that each key will be defined for the AspectJ config, so I think you need to override them in that config rather than without any config:

.settings(aspectjVersion in Aspectj := "1.8.0")


来源:https://stackoverflow.com/questions/24630595/sbt-good-way-to-override-a-plugins-setting

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!