AspectJ plugin for sbt not working

553 Views Asked by At

I am trying to add aspectJ plugin to sbt to use kamon with my akka/scala application. But I am not able to configure the aspectJ plugin correctly. Every time I am running the project I am getting this error "AspectJWeaverMissing". I have made below changes to my project to include the aspectj plugin:

1) Added plugins.sbt to my-project-dir/project/plugins.sbt

addSbtPlugin("com.typesafe.sbt" % "sbt-aspectj" % "0.10.0")

Added following library dependencies in sbt.build file:

  "org.aspectj" % "aspectjweaver" % "1.8.1",
  "org.aspectj" % "aspectjtools" % "1.8.1"

Please let me know what am I missing here? Thanks

1

There are 1 best solutions below

0
On

I'm using version 0.10.2, this is what I need to do:

val main = (project in file("."))
    .settings(aspectjSettings: _*)
    .settings(
        inputs in Aspectj <+= compiledClasses,
        products in Compile <<= products in Aspectj,
        products in Runtime <<= products in Compile
    )

You don't actually need to add those library dependencies, the plugin includes them, unless you need load-time weaving.