简体   繁体   中英

Trouble with upgrading of annotation processor code(Java) using Eclipse

I`m an android-developer but this is question for java-developer I think: I have some wierd trouble with annotation processor behaviour.

Now I`ve been developing 2 projects: one - with custom annotations and the processor, which process these custom annotations (lib-project) and the testing application which use this lib-project (test-project). I use Eclipse IDE as a developer tool (ADT).

And I faced such a trouble: my lib-project attached to test project as a jar-lib and at first it works quite well but if

1) I made changes in my lib-project (made changes to my annotation processor),

2) then rebuilt jar-lib and

3) cleaned and rebuilt my test-project then

I found out that old version of annotation processor is used for processing annotations, not upgraded one how I expect. As I figure out changes will be enable if I restart Eclipse but this biheviour is not proper. Maybe someone helps me to resolve this trouble how I can upgrade annotation processor without restarting Eclipse.

I've experienced this problem when developing my own custom annotation processor for android project using Eclipse. It seems eclipse cached the jar-lib for your annotation processor (i am not verifying this yet). You can try the following steps:

  1. Remove your jar-lib from eclipse annotation processor path
  2. Clean, rebuild an package your jar-lib
  3. Add the new jar-lib to your annotation processor path

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM