javaeclipseosgieclipse-emfmde

Loading same plugin twice with different version in Eclipse


I have two different versions of an EMF plugin which loads a certain .xmi. The latter version has been changed so that the xmi from the previous version is incompatible. What I want to do is to load the xmi's with the first plugin and then programatically build a model using the newer plugin thus migrating older models. They are identical apart from some changes within an EMF model.

How do I load these plugins? Is it possible? Are there better strategies?


Solution

  • I suggest changing the id of the old version (and possibly the EMF package URI), so you can have the two code and models simultaneously.

    As you need to handle both old and new classes in the same plug-in (the migrator), there is no way you can have both working.

    However, you shall look at the dynamic EMF technology where you could open the old model without its generated packages (on the other hand, you have to use the reflective API). Using this method you can write a converter, that opens the old model using EMF reflective API, and manually translate it into your new model version.