AspectJ and Springboot not working together

885 views Asked by At

In my project i want to use pure aspectj in combination with spring-boot While configuring the project we ran into some issues.

Found another similar problem but that doesnt help us.

This is what we did:

  • got springboot project
  • defined 2 aspects, 1 simple spring main class
  • added aspectj plugin to gradle build
  • set applicationDefaultJvmArgs to use the javaagent for aspectjweaver

Here is a link to our repo at github. https://github.com/svenhornberg/MDSD

and here is the Travis-CI build log https://travis-ci.org/svenhornberg/MDSD/builds

But it's still not working like it should.

Think i need some help here.

1

There are 1 answers

0
Andy Wilkinson On BEST ANSWER

You seem to be trying to mix compile-time weaving and load-time weaving of your classes. You should chose one approach and use it consistently.

If you want to go with compile-time weaving, remove @EnableLoadTimeWeaving from Application and update build.gradle to remove the configuration of applicationDefaultJvmArgs. There's other clean up that you could do, but these two changes should be sufficient to get your app up and running. With these changes in place, at startup I see it output:

1
Please use List instead of a concrete implementation for method: findByPrio.
[]
Please use List instead of a concrete implementation for method: returnTest.
You used a method with only one boolean parameter. Refactor it into 2 methods with True, False at the end.
true