1

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
Mik378
  • 21,881
  • 15
  • 82
  • 180

1 Answers1

4

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")
johanandren
  • 11,249
  • 1
  • 25
  • 30
  • Indeed :) However, I still get the issue: `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` :( May you have any idea? Only this plugin needs 1.7.3 by default. It's as if the version override happens AFTER the process of the plugin's instruction. – Mik378 Jul 08 '14 at 12:41
  • I tried your solution but it doesn't seem to work regarding the plugin code. So here's a gist representing all my SBT configuration dealing with this plugin: https://gist.github.com/mica16/d16b891882a439fd38c5 and a solution I tried but in vain.. (I specified the three 1.8.0 dependencies at the top of my SBT and tried to avoid the plugin to reference 1.7.3) – Mik378 Jul 08 '14 at 13:01
  • In a file `ivy-0.9.4.xml` (of the plugin) there is `"` I tried to change manually 1.7.3 to 1.8.0 but still the issue of version conflict occurs. – Mik378 Jul 08 '14 at 13:20
  • I succeeded by adding this line: `dependencyOverrides += "org.aspectj" % "aspectjtools" % "1.8.0"` – Mik378 Jul 08 '14 at 14:17