具有Xtext路径未映射异常的Xcore模型

时间:2018-05-25 17:30:57

标签: xtext xcore

我正在使用带有Model和Greeting语法的vanilla new Xtext项目。我添加了一个新的Xcore项目以及此博客文章(https://blogs.itemis.com/en/using-xtext-with-xcore-and-gradle)。我也在使用Gradle设置,如DSL项目中没有Manifest。

我已经通过build.gradle文件添加了对Xcore模型的引用,并使用了mwe2文件中的“referencedResource”。但是,尝试构建工作流程(mwe2),我得到:

sing resourceSet registry. The registered Packages will not be registered in the global EPackage.Registry.INSTANCE!
657  [main] ERROR textGeneratorResourceSetInitializer  - Couldn't initialize Xcore support. Is it on the classpath?
659  [main] ERROR textGeneratorResourceSetInitializer  - Could not load XcoreLang.xcore.
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: java.io.IOException: The path '/org.eclipse.emf.ecore.xcore.lib/model/XcoreLang.xcore' is unmapped

<snip/>
667  [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher  - Problems running workflow org.xtext.example.mydsl.GenerateMyDsl: org.xml.sax.SAXParseExceptionpublicId: platform:/resource/org.xtext.example.mydsl.model/src/mydsl.xcore; systemId: platform:/resource/org.xtext.example.mydsl.model/src/mydsl.xcore; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
java.lang.RuntimeException: Problems running workflow org.xtext.example.mydsl.GenerateMyDsl: org.xml.sax.SAXParseExceptionpublicId: platform:/resource/org.xtext.example.mydsl.model/src/mydsl.xcore; systemId: platform:/resource/org.xtext.example.mydsl.model/src/mydsl.xcore; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.

如果我在语法(xtext文件)中点击F3,它会找到相应的Xcore定义,所以我无法弄清楚引用在哪里出错了。如何修复此路径未映射的异常?

0 个答案:

没有答案