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
0
votes
1 answer

Spring @configurable NullPointerException

I tried to use @configurable on my project to have @autowired service in object that are outside of spring context or something like that but didn't manage to make it work. The service is always null. (I compared 4 different tutorials but nothing…
0
votes
1 answer

AspectJ (Spring) + how to add the embedding of an aspect in a private method and get the specified data

I have created an aspect that should embed logging on methods marked with an annotation and with the private modifier. In addition, I would like to add information to the log that will be available at the time of execution of the method (for…
skyho
  • 1,438
  • 2
  • 20
  • 47
0
votes
1 answer

How to force AspectJ search from test directory in src directory of project using compile weaving?

Actually, it will be more complex question. I want use AspectJ only in test purpose. Have found suggestion to use if() JointPoint and some static boolean field. Also, first I start using aspect as inner static class of my base test method. After…
0
votes
2 answers

java.lang.ClassNotFoundException: java.lang.constant.Constable after upgrading libraries

I have an application running in Tomcat 9.0.45 with JDK 11 (OpenJDK 11.0.11). After upgrading some libraries (Spring 4.3.30 to 5.3.9) using maven, the application throws the following Exception: java.lang.NoClassDefFoundError:…
Manuel M
  • 809
  • 1
  • 10
  • 25
0
votes
0 answers

AspectJ- Calling the aspect function from another project throws NoClassDefFoundError: org/aspectj/lang/JoinPoint

Requirement: - We have a Java methodA in ProjectA. This methodA is used across different teams by adding JAR dependencies to their POMs. We want to collect some metrics, like which teams are calling methodA. Idea: I am exploring using AspectJ in my…
0
votes
1 answer

Maven testcases are not invoking AspectJ Aspects

I have added the Junit test case to call a method with Annotation which in turn have the Around aspect. When i run the mvn test command, The Aspect is not getting invoked for some reason. But when i build the jar using mvn package and run the jar,…
Chandru
  • 3
  • 3
0
votes
1 answer

Is there a way I can have the aspectj maven plugin ignore missing weave dependencies instead of failing the build?

I wrote an aspect library that auto-instruments traces and because most of the developers using this have multi-module projects, it would be nice if they could just configure the aspectj-maven-plugin for compile-time weaving in the parent pom.xml…
Brady Goldman
  • 347
  • 1
  • 4
  • 11
0
votes
2 answers

AspectJ annotations are not working in JAVA maven project (Not spring project)

I'm trying to implement AspectJ annotations in JAVA maven project without spring. I have added Aspects and create annotation. But its not invoking the Aspects where i have added as Annotation to the method..Below is my code..Also the project link -…
Chandru
  • 3
  • 3
0
votes
1 answer

AspectJ does not runs without -javaagent argument

I'm trying to use AspectJ in a simple java app, without using of Spring. project is controlled by maven. Here is the project code, you can see it also on a GitHub App.java package ge.jibo.aspectj; public class App { public static void…
JiboOne
  • 1,438
  • 4
  • 22
  • 55
0
votes
1 answer

How should I use @Configurable to automatically assemble beans into common objects in springboot

What I need now is to have an ordinary abstract class and its subclasses. These beans need to be injected into the abstract class. They are just ordinary objects, but have some ioc-managed beans to perform operations. I need to serialize them into…
Tablo_Jhin
  • 301
  • 1
  • 3
  • 10
0
votes
1 answer

Gradle + AspectJ log tracing is trying to recompile the project during “instrumentation” and failing

Edit: I've pushed dummy source code here https://github.com/swapnil-kotwal-sp/basic-demo It seems to be compiling as well as doing AspectJ instrumentation as well? But, I'm getting warning during instrumentation as [ant:iajc] [warning] build config…
Swapnil Kotwal
  • 5,418
  • 6
  • 48
  • 92
0
votes
0 answers

AspectJ Maven Plugin get a java.lang.NullPointerException

I've got a projet with 121 class. I use Maven to compile. I start by generate source with lombok-maven-plugin then i use aspectj-maven-plugin to compile and weave. But, when I'm trying to compile with aspectj-maven-plugin. But when the step…
0
votes
0 answers

Junit tests fail with mvn clean install for aspectj decorated classes

I am trying to use aspectj-metrics for metering/timing my non resource methods. E.g: @Metrics(registry = "metric-registry") public class CustomStage extends BaseStage { // .... @Override @Timed(name = "metricName") public…
hrrray
  • 9
  • 5
0
votes
0 answers

AspectJ maven plugin with annotation processor - sources are generated twice

I'm experiencing some strange behaviour when combining the AspectJ compiler plugin with an annotation processor that generates sources. I have Project A, the main project with annotated classes. I have Project B, the dependency project with aspect…
Morgan
  • 907
  • 1
  • 13
  • 35
0
votes
1 answer

AspectJ Java maven ajc: target JDK should be comprised in between '1.1'and '1.4':8

I am getting this error running a Java Maven project on a new computer using Intellij IDEA. Google did not show any useful info. It builds fine but when I start the Tomcat server in Intellij, this error pops up right away. I suspect it has sth to do…
user3277841
  • 339
  • 2
  • 6
  • 17