eclipse-plugineclipse-emfemfxcore

'GenModel cannot be resolved' errors


Suddenly there are build error in all of my Xcore model files. I don't know what I changed in my projects to deserve this.

The error message is the one in the title of the post:

GenModel cannot be resolved.

The errors are from the GenModel annotation on the package declarations of the XCore files:

@GenModel(modelDirectory="/com.organisation.project/src-gen")
package com.organisation.project.package;

Details


Solution

  • I think I had this problem because Eclipse was confused about the target platform somehow.

    Possibly the reason was that I had the EMF source code project opened in my workspace. When I closed them Eclipse did not understand that it again had to used EMF from the target platform.

    Setting the target platform to Running Platform, then setting it back again resolved the issue. (The same technique that is recommended at Vogella.)