首先,我是新的Acceleo和eclipse的建模功能。我想要做的只是創建一個簡單的測試文件。所以對於初學者來說,我創建了一個主模塊:Acceleo:代無法生成任何文件
comment encoding = UTF-8 /]
[module generate('file:/C:/Users/maria/Documents/workspace/org.eclipse.acceleo.module.m2tTransformation/model/PSMMetamodel.ecore')]
[template public generateElement(aServicePSM : ServicePSM)]
[comment @main/]
[file ('test.java', false, 'UTF-8')]
Test
[/file]
[/template]
當我運行此我得到:
The generation failed to generate any file because there are no model elements that matches at least the type of the first parameter of one of your main templates.
The problem may be caused by a problem with the registration of your metamodel, please see the method named "registerPackages" in the Java launcher of your generator. It could also come from a missing [comment @main/] in the template used as the entry point of the generation.
另外的URI我用的是nsURI屬性值我設置爲元模型的根。我確定我的輸入模型確實包含ServicePSM元素。 我在做什麼錯?
在此先感謝。