Running ApsctJ in Intellij IDEA with Scala

348 Views Asked by At

I am using Intellij IDEA Community Edition 14.0.3 for Scala development. I am having AspectJ in my application. I am using sbt-aspect v0.10.1. I am able to run everything fine when I run the application from SBT console. However, when I use run from the intellij menu, it is not invoking the aspect. Because of this, I am not able to run in Debug Mode. How can I make it work with intellij ?

2

There are 2 best solutions below

0
On

I have the same issue. My workaround is:

  • Open project Run/Debug configuration on IntelliJ IDEA
  • In the VM Options field type: -javaagent:path/to/aspectjweaver.jar

    path/to/aspectjweaver.jar in my case is C:\Users\aelkin\.ivy2\cache\org.aspectj\aspectjweaver\jars\aspectjweaver-1.8.13.jar

0
On

Actually I do not use Scala in IntelliJ IDEA, but Java. Anyway, a quick web search led me to the SBT Community Plugins page which lists these links:

Plugins for IDEs

IntelliJ IDEA

At the time of writing this GitHub is down for database maintenance, so I cannot check on the projects mentioned there, but in 15 minutes or you should be able to navigate there by yourself and see if the repos actually contain something useful for you.