Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2t-dev] acceleo maven plugin

Hi,

You need to register your metamodel in the Java launcher of your generator (the Java class generated next to your main module) in its registerPackages method. You can see an example on Github [1].

Regards,

Stephane Bégaudeau, Obeo


Le 18 nov. 2014 à 17:52, LE FEVRE FRANCOIS <francois.le-fevre@xxxxxx> a écrit :

Dear Accelo maven plugin community,
I have just tried to setp up a small example of accelo maven plugin.
 
I get one error:
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.
 
I have used the example maven project /org.eclipse.acceleo.maven.tests
When I run the mvn install, it generates well the class, the emlt files and the artifact.
 
Then I have created a small maven project with an uml model, the same of the example
I have defined in my pom the call of the previous plugin.
 
 
<plugin>
                          <groupId>org.eclipse.acceleo</groupId>
                           <artifactId>org.eclipse.acceleo.maven.launcher</artifactId>
                          <version>3.5.0-SNAPSHOT</version>
                          <executions>
                                 <execution>
                                       <phase>process-resources</phase>
                                       <goals>
                                              <goal>acceleo-launcher</goal>
                                       </goals>
                                 </execution>
                          </executions>
                          <configuration>
                          <generatorClass>org.eclipse.acceleo.module.example.uml2java.helios.GenerateJava</generatorClass>
                                
                                 <model>${basedir}\src\main\model\example.uml</model>
                                 <outputFolder>${basedir}\src</outputFolder>
                          </configuration>
                          <dependencies>                                <dependency>
                                       <groupId>org.eclipse.acceleo</groupId>
                                       <artifactId>org.eclipse.acceleo.maven-test</artifactId>
                                       <version>3.6.0-SNAPSHOT</version>
                                 </dependency>
                          </dependencies>
                    </plugin>
 
But whatever I do it generates the error
please see the method named "registerPackages" in the Java launcher of your generator. It could also come from a missing [comment @main/]
 
I have checked that in my /org.eclipse.acceleo.maven.tests/src/main/java/org/eclipse/acceleo/module/example/uml2java/helios/generateJava.mtl
I have the following lines:
[template public generateClass(c : Class)]
[comment @main /]
 
Thanks for your help.
 
 
Francois
 
_______________________________________________
m2t-dev mailing list
m2t-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/m2t-dev


Back to the top