Questions tagged [aspectj-maven-plugin]

Handles AspectJ usage within Maven.

Handles AspectJ usage within Maven.

The following functionalities are provided: weaving of aspects (or existing aspects from libraries) with the test and/or main classes, weaving of pre-existing jars and ajdoc reporting.

Check the official usage page for a first look at it.

More Info

212 questions
3
votes
1 answer

AspectJ unmatched type warning: how to interpret?

My goal is to 'around' all the equals methods of the subclasses of a type. So, I wrote the following aspect. I'm using the aspectj-maven-plugin, and I'm telling it to weave the code in a dependency jar file, since that's where all the equals methods…
bmargulies
  • 97,814
  • 39
  • 186
  • 310
3
votes
2 answers

Unit testing with AspectJ in Java

I'm developing an application which uses AspectJ with Java. In development, I use ajc and java together. AspectJ calls some code segments when necessary and I want to test these code segments called by AspectJ. I tried to do it with Mockito but I…
mtyurt
  • 3,369
  • 6
  • 38
  • 57
3
votes
2 answers

Maven doesn't weave aspectj code

I'm facing problems to build an aspect project in eclipse with maven. When I run maven through eclipse "Run As > Maven build" I obtain this message: <...>/Clazz.java:[5,32] error: cannot find symbol. So, it looks like aspectj is not weaving the code…
csfb
  • 1,105
  • 1
  • 9
  • 19
3
votes
0 answers

how to specify path to aop.xml using aspectj maven plugin

Hi My problem is pretty much same as AspectJ Plugin Aspect Config with Maven using external Jar for Aspect Here is my pom.xml org.apache.maven.plugins
hrishikeshp19
  • 8,838
  • 26
  • 78
  • 141
2
votes
1 answer

How to use AspectJ + Lombok + Maven + IntelliJ?

org.codehaus.mojo aspectj-maven-plugin 1.10 true
Mary
  • 35
  • 5
2
votes
2 answers

Spring aspects woven by AspectJ compiler working in Maven, but not in IntelliJ IDEA

I'm using Spring boot 2.5.5 with AspectJ 1.9.7 (CTW). I've spotted that sometimes transactions don't roll back and to fix that I need only recompile code and run it again. For example: I have method addB() persisting entity B, method addC() throwing…
2
votes
0 answers

Does AspectJ (Mojo's Maven Plugin in particular) perform optimization?

I am benchmarking a simple application that makes use of Mojo's AspectJ Maven Plugin. I noticed that just by including the aspectj dependencies in my pom.xml, the benchmark program runs 3x faster.
starboost
  • 93
  • 1
  • 3
2
votes
1 answer

Is it possible to measure time performance of the functions that are called inside jar of some library?

I am using some library in my maven based project. The jar of this library may/may not contain some other dependent libraries. I am calling xyz function of this library. There is a requirement where I need to check time taken by each of the…
user
  • 383
  • 1
  • 5
  • 20
2
votes
0 answers

AspectJ maven plugin compile time memory exceeds error

Hi I am using compile time AspectJ to weave classes However some classes are so big that at compile time it is not able to weave it. so I have already tried adding argument in plugin: -Xmx2048m pom.xml:
2
votes
2 answers

AspectJ - Aspect from external JAR

I've added a github repo that show exactly my problem: https://github.com/runefist/AspectJ-Stackoverflow-Q In short, I have a project we'll call it ProjectA. ProjectA is a microprofile-REST-server. Another project, we'll call this ProjectB, is a…
runefist
  • 543
  • 1
  • 8
  • 19
2
votes
1 answer

Aspectj pointcut targetting annotation from optional dependency

I'm using aspectj to target methods using a third-party annotation. However, I can't guarantee that this annotation will be available on the classpath. Is there a way to target an annotation from an optional dependency? As an example, I might want…
Roddy of the Frozen Peas
  • 14,380
  • 9
  • 49
  • 99
2
votes
0 answers

Cannot compile Maven project against Java 6 when using AspectJ plugin

I recently upgraded to Maven 3.5 and Java 8 on my dev environment as I have upgraded my company's Maven-managed application from Java 6 to Java 8 on our 'master' environment. Unfortunately I have run into difficulty using this setup against older…
2
votes
1 answer

How to force compile error with aspectJ pointcut mismatch

I have the following aspectJ pointcut: @Around(value="execution(* *(*,Map)) && @annotation(com.xxx.annotations.MyCustomAnnotation)") As you can see, this pointcut only matches methods, annotated with…
mdzh
  • 1,030
  • 2
  • 17
  • 34
2
votes
0 answers

Failed to run spring boot application when using aspectj as seperate module

I have an application which uses aspectj for logging purposes. Initially aspectj module was used inside my original application. Later I moved the aspectj module as a separate project and added that module dependency in my main project. Now when I…
Anoopkr05
  • 73
  • 1
  • 6
2
votes
1 answer

Whether it is possible to write AOP for Spring RestTemplate class and any external jar classes using spring AOP or Aspectj

Is it possible to write AOP for Spring RestTemplate class using spring AOP or Aspectj. EX: @Around("execution(* org.springframework.web.client.RestTemplate.getFor*(..))")   Thanks
thangavel vel
  • 21
  • 1
  • 2
1 2
3
14 15