SBT/覆盖插件设置的好方法 [英] SBT / Good way to override a plugin's setting

查看:83
本文介绍了SBT/覆盖插件设置的好方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更改

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.

当前插件的设置为:

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

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

我自己项目的Mu当前SBT开始如下:

Mu current SBT for my own project starts as following:

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

通过aspectjVersion := "1.8.0"覆盖" aspectjVersion := "1.7.3"的一种好方法是什么?

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"): _*)

我仍然有此错误:

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

推荐答案

如果您查看第56行,则使用

If you look at line 56 the settings are defined with

 inConfig(Aspectj)(defaultAspectjSettings) ...

这意味着将为AspectJ配置定义每个键,所以我认为您需要在该配置中覆盖它们,而不是不进行任何配置:

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")

这篇关于SBT/覆盖插件设置的好方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆