2
votes

Some of my test cases are using aspectj, So I'd like to specify something like:

-javaagent:C:\Users\lma.ivy2\cache\org.aspectj\aspectjweaver\jars\aspectjweaver-1.7.4.jar

to sbt when executing test from command line.

Any suggestions on how to ?

Btw, better to not change the sbtconfig.txt, which will impact other tests. Just like it to be on-demand thru command line.

Thanks

Leon

2

2 Answers

0
votes

i do this with jrebel which requires the javaagent to be set as well. from the command line:

java -jar -javaagent:jrebel.jar sbt-launcher.jar test

0
votes

I recommend to try SBT AspectJ https://github.com/sbt/sbt-aspectj

After adding a plugin to plugins.sbt like

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

check out samples: https://github.com/sbt/sbt-aspectj/tree/v0.10.0/src/sbt-test to find a configuration that matches your needs (e.g. only loading in tests)