[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] relocation of aspectj classes in a java agent

Hi All
We are developing a kind of jvm profiler and we want to use aspectj load time weaving.
we're going to use this tool for various application which we know nothing about in advance. and we suspect that some of them are already using aspectj in some way.
We use gradle to package our tool and wanted to relocate the aspectj classes but it looks impossible.
I think its because aspectjweaver uses string constants to test if a class is an aspect, something like that:

public final static UnresolvedType ASPECT_ANNOTATION = UnresolvedType.forSignature("Lorg/aspectj/lang/annotation/Aspect;"

and when relocating the project dependencies our aspects doesn't import or.aspectj.. anymore but shadow.org.aspectj.. and so the weaver complains that the class is not an aspect and does not register our aspects.
i tried various ways to solve it like excluding some classes or all the org.aspectj.lang package but nothing worked.Â
I did try stackoverflow but didn't get any good help there.
would appreciate if someone can help suggesting what we could do. of course i could use pure asm to do that or bytebuddy but i find aspectj the best for our needs.

Thank you