sbt-jacoco icon indicating copy to clipboard operation
sbt-jacoco copied to clipboard

working with sbt-aspectj

Open tutufool opened this issue 10 years ago • 1 comments

Hi,

I'm using sbt-aspectj plugin to do runtime weaving for my code.

The config for aspectj plugin is something like:

lazy val aspectJSettings = aspectjSettings ++ Seq( aspectjVersion := Dependencies.aspectjVersion, compileOnly in Aspectj := true, fork in Test := true, javaOptions in Test <++= weaverOptions in Aspectj, javaOptions in run <++= weaverOptions in Aspectj, lintProperties in Aspectj += "invalidAbsoluteTypeName = ignore" )

I believe it will finally add "-javaagent:aspectjweaver-1.x.x.jar" to the java command.

It works well when I do sbt test

However, when I try to do jacoco:cover

The test case failed due to the aspectj not working.

I'm wondering whether jacoco's instrument has some conflict with apsectj's?

btw, I use addSbtPlugin("com.typesafe.sbt" % "sbt-aspectj" % "0.9.4") and aspectj weaver 1.7.4

Thanks

Leon

tutufool avatar Jul 10 '14 09:07 tutufool

Hi, @tutufool

Any progress on this? Currently, I'm issuing problem with AspectJ Weaver Missing message in tests. I need to provide path to Java agent .jar in javaOptions but sbt jacoco:cover override that. I'm using sbt-aspectj-play-runner 1.0.1 and sbt-aspectj 0.10.6. Also, when I type sbt test it works fine.

Thanks in advance.

drmarjanovic avatar Jul 06 '17 16:07 drmarjanovic