Ant Builder Build Failed eINSTANCE

自闭症网瘾萝莉.ら 提交于 2019-12-08 04:03:37

问题


Trying to use AcceleoCompiler with an Ant Builder. When i build with ant i get the following error:

compile:
[acceleoCompiler] eINSTANCE

BUILD FAILED
C:\Users\random\workspace\foo\bar\Framework\buildstandalone.xml:52: eINSTANCE

Here is how i have my target defined and some other information that could be important. I am very new to ant and acceleo. Let me know if there is any other information you need. I am not sure that any of the below is correct, let me know if there is anything i need to change. The line that it is complaining about is packagesToRegister="org.eclipse.acceleo.parser.compiler.AcceleoCompiler"> I do not know if that line is correct at all, i was just guessing.

<path id="Framework.classpath">
    <path refid="Framework.libraryclasspath"/>
</path>

<taskdef id="acceleoCompiler" name="acceleoCompiler" classname="org.eclipse.acceleo.parser.compiler.AcceleoCompiler"
         classpathref="Framework.libraryclasspath">
</taskdef>

<target name="compile">
<acceleoCompiler sourceFolder="${SOURCE_FOLDER}"
                 outputFolder="${OUTPUT_FOLDER}"
                 dependencies=""
                 binaryResource="true"
                 packagesToRegister="org.eclipse.acceleo.parser.compiler.AcceleoCompiler"></acceleoCompiler>
</target>

回答1:


The line packagesToRegister is a reference to the package of your metamodel for example, if your generator is using the UML metamodel, you should register the package org.eclipse.uml.uml2.UMLPackage (or something like that), you can see the package needed to register in the method registerPackage of the Java launcher class of your generator. The AcceleoCompiler is not a package to register (that's why the variable eINSTANCE is not found on AcceleoCompiler). If you have generated the code of your own metamodel, you should look for a **Package class generated by EMF.



来源:https://stackoverflow.com/questions/8246245/ant-builder-build-failed-einstance

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