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();
}
public class IAspectDefaultImpl implements IAspect
{
@Override
public String hello()
{
return "hello";
}
}
@Aspect
public class AspectJ
{
@DeclareParents(value = "@SomeAnnotation*", defaultImpl = IAspectDefaultImpl.class)
private IAspect implementedInterface;
}
Target Class in a different project:
@SomeAnnotation
public class MyClass
{
private final int myValue;
public MyClass(final int wert)
{
this.myValue = wert;
}
public int getMyValue()
{
return myValue;
}
}
Maven throws me:
The type MyClass must implement the inherited abstract method IAspect.hello()
Which implies that it works partially. When looking at the decompiled .class files the targeted Class does in fact implement IAspect. The method defined in IAspectDefaultImpl is still missing tho.
My pom is set up like in this example.
I am not sure where I should start to look for errors. Any help is apreciated.