Eclipse - record and apply move and rename refactorings to another workspace

拥有回忆 提交于 2019-12-05 12:01:19

Answering my own question to get some closure here.

The easiest way to do it is to use the Migrate JAR File... refactoring which uses a refactoring script in META-INF called REFACTORINGS.XML. You can get a JAR with this included automatically by using Export JAR in Eclipse. We build with Maven and thus just do Refactoring->Create Script... and put it into the appropriate position in the JAR.

The JDT-internal code that Migrate JAR executes creates Stubs for the source classes in a temporary source folder, so it actually executes the refactoring first and then updates the references. The user never gets to see these temporary files.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!