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
1
vote
1 answer

Compile-time weaving based injection not working

I've been using compile-time weaving for a while now to get some spring components into a Hibernate Search FieldBridge: @Configurable public class MultiLingualClassBridge implements FieldBridge,ParameterizedBridge { @Inject MessageSource…
Marc
  • 6,773
  • 10
  • 44
  • 68
0
votes
1 answer

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 use an unusually dependency graph of…
0
votes
0 answers

Compile-time weaving causing unnecessary error/exception

I'm new in using spring boot I'm currently working on a project that requires me to log the execution of a method (elapsed time and result) using aop. I can use spring-aop just fine, the problems comes when the aop cannot capture the internal method…
0
votes
1 answer

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("!within(AnalyzerAspect) && statement() &&…
0
votes
1 answer

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("!within(AnalyzerAspect) && statement() &&…
0
votes
1 answer

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] Failed to execute goal…
dynamo
  • 184
  • 13
0
votes
1 answer

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 offer this jar to our maven repository, so they can…
0
votes
0 answers

Running aspect on an Annotated Class using AspectJ

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 called. Can we do this in AspectJ? Annotation…
gamelover
  • 15
  • 4
0
votes
0 answers

Avoid aspects overriding in AspectJ

I have two different aspects in my Selenium test automation project and I am using load time weaving with AspectJ. Both aspects run fine when running under test methods in that class. The case where AspectA running on…
gamelover
  • 15
  • 4
0
votes
3 answers

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.springframework.jdbc.core.JdbcTemplate.update*(..)))") public void…
Akshay Som
  • 121
  • 1
  • 5
0
votes
1 answer

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 Maven, the last version too. How to reproduce: git…
0
votes
0 answers

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 common jar so that other projects can use it. I add…
Kim
  • 1
  • 1
0
votes
1 answer

Get class name, where method is implemented, with AspectJ

I have a class with methods that has annotation (io.qase.api.annotation.Step) Class myStepsClass() { @Step fun stepOne() {***} @Step fun stepTwo() {***} } I would like to print "step" method name during the execution, and show a Class name where…
mikamika
  • 110
  • 1
  • 6
0
votes
2 answers

AssertJ custom Aspects doesn't work with maven-surefire-plugin

I have the maven project written on Kotlin. pom.xml uses maven-surefire-plugin plugin: org.apache.maven.plugins maven-surefire-plugin
mikamika
  • 110
  • 1
  • 6
0
votes
1 answer

How to apply aspects and execute Junit tests using Maven without changing the source Maven project

In a Maven project A, there are a couple of Junit tests for some Java components. My goal is to apply an aspect (using AspectJ) to the component classes and then execute the Junit tests. The aspect will do some counting of the component method…
cnmuc
  • 6,025
  • 2
  • 24
  • 29