aspectj-maven-plugin

Maven Aspectj plugin calls the JPA model generator again

主宰稳场 提交于 2021-02-08 14:00:08
问题 I have a Maven project where I generate the JPA metamodel using the Hibernate metamodel generator. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>xxx</groupId> <artifactId>xxx</artifactId> <version>1.0.0-SNAPSHOT</version> </parent> <artifactId>xxx</artifactId> <dependencies>

Aspectj exceptions handling on multiple matching advices

北慕城南 提交于 2021-02-05 10:39:14
问题 I have 2 aspects that are applied on the same method. When the method executes correctly I have no problem, everything is working fine and both aspects work as expected. The problem is when the method throw an exception. In these cases, the first aspect re-throw correctly the exception, but the second aspect is generating a nullpointerexception. I was able to reproduce the problem isolating the case on a unit test in a separated project. Those are the aspects (actually I removed all the logic

Aspectj exceptions handling on multiple matching advices

Deadly 提交于 2021-02-05 10:39:05
问题 I have 2 aspects that are applied on the same method. When the method executes correctly I have no problem, everything is working fine and both aspects work as expected. The problem is when the method throw an exception. In these cases, the first aspect re-throw correctly the exception, but the second aspect is generating a nullpointerexception. I was able to reproduce the problem isolating the case on a unit test in a separated project. Those are the aspects (actually I removed all the logic

Aspectj class is not found by test class when running test with maven

佐手、 提交于 2021-01-29 09:44:01
问题 I have created a test for my aspectj class. When I execute my test it works fine to "Run as TestNG" from Eclipse. Then when I execute it in maven: mvn clean test I get the following error: [15:15] [eraonel/git/java-runtime-stats] -> mvn clean test [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building java-runtime-stats 0.0.1 [INFO] ------------------------------------------------------------------------ [INFO]

Does Mojo's AspectJ Maven Plugin work with jdk 9+?

夙愿已清 提交于 2020-08-25 06:59:39
问题 I have a project that uses Mojo's AspectJ Maven Plugin. It works fine with jdk 8. When I try to switch to jdk14, the build fails with the following error: [ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.11:compile (default) on project AspectJDemo: Execution default of goal org.codehaus.mojo:aspectj-maven-plugin:1.11:compile failed: Plugin org.codehaus.mojo:aspectj-maven-plugin:1.11 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools

AspectJ @DeclareParents defaultImpl code is not used when using it as dependency

早过忘川 提交于 2020-01-25 10:12:49
问题 I am working with AspectJ at the moment. I seperated AspectJ code in a dependency. Within that dependency everything works as intended. But as soon as I import it in another project only some functionality does not work anymore. When using the defaultImpl of @DeclareParents, the interface is shown within the compiled code but not the default Implementation. Here is my code to show what I mean (every code snippet is its own File): AspectJ code: public interface IAspect { String hello(); }

Advice AspectJ a method call from different Maven project

狂风中的少年 提交于 2020-01-07 00:42:31
问题 I am trying to create an advice of a method of a project (test5) being called from another project (testMaven). I already included the project test5 as dependency in testMaven's pom.xml and set up an advice in testMaven's class but still it doesn't get executed. The calling of the method (dfg) is working just fine. Here are the code for it: MainApp.java (testMaven) package testMaven; import test5.yxc; public class MainApp { public static void main(String[] args) { yxc b = new yxc(); b.dfg(2);

Dependency Error AspectJ Maven Plugin Installation For com:sun:tools:jar

蓝咒 提交于 2020-01-04 07:25:06
问题 I would like to run the Maven project that I have on https://github.com/ihsanhaikalz/testMaven in the Eclipse 4.5 (Mars) but it gave me an error in the pom.xml as follow: 1 problem was encountered while building the effective model for org.codehaus.mojo:aspectj-maven-plugin:1.8 [ERROR] 'dependencies.dependency.systemPath' for com.sun:tools:jar must specify an absolute path but is ${toolsjarSystemPath} @ I already installed AJDT for Eclipse 4.5 through http://download.eclipse.org/tools/ajdt/45

AspectJ advice does not fire in Maven multi-module setup

﹥>﹥吖頭↗ 提交于 2020-01-02 07:17:09
问题 I'm trying to do AOP with Aspectj, but I don't know why is not executing my aspect, it just runs the main class. Is the first time I do this, so I might be doing something wrong. This is my code: The Aspect: @Aspect public class YourAspect { @Pointcut("@annotation(yourAnnotationVariableName)") public void annotationPointCutDefinition(YourAnnotation yourAnnotationVariableName){ } @Pointcut("execution(* *(..))") public void atExecution(){} @Around("annotationPointCutDefinition

Maven AspectJ plugin fails to build with Java 9 due to missing tools.jar

旧巷老猫 提交于 2019-12-20 12:36:11
问题 I switched my JDK version from 8 to 9 and the AspectJ plugin no longer works due to missing tools.jar: Execution default of goal org.codehaus.mojo:aspectj-maven-plugin:1.10:compile failed: Plugin org.codehaus.mojo:aspectj-maven-plugin:1.10 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:9.0.1 at specified path C:\Program Files\Java\jdk-9.0.1/../lib/tools.jar I understand that tools.jar (and rt.jar) were removed from Java 9 JDK. I am wondering if