I have two types of annotation in my project: Annotation1
and Annotation2
. Both are runtime annotations. So, my question is how to keep only Annotation1
and strip Annotation2
?
Example:
class Test {
@Annotation1
@Annotation2
String name;
}
I want Annotation2
to be removed from all fields and Annotation1
to be kept everywhere.
I can't find whether this is possible. I only know how to keep all annotations using:
-keepattributes *Annotation*
Is this possible? If not, why?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…