a few weeks ago i was looking for a way to create some String constants for the fileds of a java class -> Generate constants for class attributes with maven?
I got it working. I create an aspect containing the constants and weave them into the class files. The problem is now, that my clients get an NoClassDefFound Exception when they try to use the weaved class. There are two reasons for that:
I'm removing the aspect .class files from the client jar during the build process
They do not have an aspectj lib in their classpath
Using a decompiler, i found out that the class got a static block like this:
static {
CarDTOAspect.ajc$interFieldInit$my.package.CarDTOAspect$my.package.CarDTO$VENDOR();
CarDTOAspect.ajc$interFieldInit$my.package.CarDTOAspect$my.package.CarDTO$NAME();
}
My question: Is there an option in the weave procedure, that creates real "public static final String"-Field in my class file, so that i can totally get rid of the aspects in my client jar?
Thanks in advance
martin