简体   繁体   中英

'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

  • The plug-ins do specify the org.eclipse.emf.ecore.xcore.lib required bundle. PDE reports no errors for the require bundle clause in the manifest file.
  • The Target Platform State view in Eclipse contains the org.eclipse.emf.ecore.xcore.lib bundle.
  • If I add the following line in the Xcore files then the build errors disappear:

     annotation "http://www.eclipse.org/emf/2002/GenModel" as GenModel
  • Xcore SDK version: 1.4.0
  • EMF SDK version: 2.12.0
  • Eclipse for RCP and RAP Developers version: 4.6.2

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 .)

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