【问题标题】:AspectJ plugin for sbt not working用于 sbt 的 AspectJ 插件不起作用
【发布时间】:2014-12-10 21:44:17
【问题描述】:

我正在尝试将 aspectJ 插件添加到 sbt 以在我的 akka/scala 应用程序中使用 kamon。但我无法正确配置 aspectJ 插件。每次我运行项目时,都会收到此错误“AspectJWeaverMissing”。我对我的项目进行了以下更改以包含 aspectj 插件:

1) 将 plugins.sbt 添加到 my-project-dir/project/plugins.sbt

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

在 sbt.build 文件中添加了以下库依赖项:

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

请让我知道我在这里缺少什么?谢谢

【问题讨论】:

    标签: akka sbt-aspectj


    【解决方案1】:

    我使用的是 0.10.2 版本,这是我需要做的:

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

    您实际上不需要添加这些库依赖项,插件包含它们,除非您需要加载时编织。

    【讨论】:

      猜你喜欢
      • 2013-04-03
      • 1970-01-01
      • 2019-05-19
      • 2015-06-06
      • 2012-03-17
      • 2015-09-30
      • 2015-02-05
      • 2016-10-30
      • 1970-01-01
      相关资源
      最近更新 更多