212 questions
1 vote
1 answer
96 views
How to restrict aspectj-maven-plugin to only weave aspects from a dependency and ignore local aspects in the project
I’m currently using AspectJ alongside Spring AOP in my Maven project. I want to enable compile-time weaving for aspects that are provided by a dependency (my-aspect-library) while retaining Spring’s ...
0 votes
1 answer
68 views
Basic implementation of AspectJ not working
I have written a simple module in IntelliJ (Java 11 + Maven 3.6) to test AspectJ functionality. However, the Aspects are not working as expected. Can someone tell what I am doing wrong? Here is my ...
0 votes
2 answers
294 views
aspectj compile time weaving - ajc$perSingletonInstance is null
I aimed to implement compile-time weaving in my codebase and discovered the AspectJ Maven plugin (https://dev-aspectj.github.io/aspectj-maven-plugin/). aspectj.version = 1.9.21 maven-compiler.version =...
0 votes
1 answer
177 views
aspecj-maven-plugin, weaving dependency feature, random load java class
I use maven-aspectj-plugin in a multi modules project using maven as a dependency tool. A simple demo project, you could find here demo-project. At my real project, for the compatibiliy with lombok, I ...
1 vote
1 answer
65 views
java.lang.IllegalStateException: Per-clause not recognized: pmAspect
I have a problem with the <aop:aspectj-autoproxy/> configuration tag. I have added aspectjrt.jar and aspectjweaver.jar, but my setup still is not working. <dependency> <groupId>org....
0 votes
1 answer
681 views
Aspect which intercept all sql queries
I have a library with aspect which scan all statement executions and doing some logic with sql sentence. @Pointcut("target(java.sql.Statement)") public void statement() {} @AfterReturning(&...
0 votes
1 answer
253 views
How to weave hibernate by aspectj?
I have a library with aspect which scan all statement executions and doing some logic with sql sentence. @Pointcut("target(java.sql.Statement)") public void statement() {} @AfterReturning(&...
0 votes
1 answer
3k views
AspectJ Maven Plugin wont compile my project after upgrading to java 11
I am trying to upgrade a project from java 8 to 11. I have updated the pom but i get an error about aspectJ not being able to compile it when running the build. Here is the error i get below. [ERROR] ...
0 votes
1 answer
175 views
How to change pointCut expression inside an aspect which has been compiled when I use this aspect in other project?
I have a logging aspect like this, it will print args, result or any other exceptions. I use aspectj-maven-plugin to compile this aspect. Then, the compiled result will be packaged to a jar. I will ...
1 vote
1 answer
458 views
Need to exclude AspectJ closure classes from Jacoco coverage
We need to use AspectJ compile time weaving and that is creating the AjcClosure classes. Somehow the package weaving is not working for us. We need to exclude these AjcClosure classes from the ...
0 votes
0 answers
27 views
Running aspect on an Annotated Class using AspectJ [duplicate]
I have a class annotated with a custom annotation. I want to run an aspect that should trigger before all the method calls and constructor call whenever an object or static method of that class is ...
1 vote
1 answer
251 views
Aspect not getting called on non-spring maven project
I'm using Java 8, testng, maven and selenium for UI automation frame work and trying to use aspectj to execute aspects before and after for switching iframes(entry and exit) when any method in an ...
0 votes
3 answers
3k views
AspectJ not working with compile time weaving
I'm trying to do a SQL query profiling using AOP Below is my snippet from @Aspect defenition @Pointcut("(call(* org.springframework.jdbc.core.JdbcTemplate.query*(..)) || call(* org....
0 votes
1 answer
128 views
SpringBoot, AOP and tests: ok in Eclipse, but it fail in Maven
I beg for your help. For my project, https://github.com/hdsdi3g/prodlib, module jobkit, I can't pass 4 tests who pretend to validate calls via @Aspect. Ok with Eclipse (the last version). Ko with ...
0 votes
0 answers
560 views
meet some problems about aspectj-maven-plugin and aspectj
I meet some problems about the way of using aspectj-maven-plugin and aspectj. First: I create ProjectA. It will be a 'compiled aspect' jar to intercept some functions of Logback and it is a public ...