|Java Code Generation with MoDisco [message #574730]
||Mon, 19 April 2010 15:35
| Philip Mayer
Registered: July 2009
I am trying to invoke the modisco java code generator, as described on the website http://wiki.eclipse.org/MoDisco/Components/Java/Documentatio n/0.8#Java_Generation
The MoDisco website (http://wiki.eclipse.org/MoDisco/Components) states that the full java metamodel and the code generation is only available in "MoDisco 0.8". The same page also says that "MoDisco 0.8" is for helios. So I assume that I need Helios, right?
I installed Helios M6 + Acceleo (from the Helios Update Site, v3.0.0) + the milestone modisco update site ( http://download.eclipse.org/modeling/gmt/modisco/updates/mil estones/). Now, the website http://wiki.eclipse.org/MoDisco/Components/Java/Documentatio n/0.8#Java_Generation states two methods of invoking the code generator:
a) use the import plugin wizard for the java.generation package and run an Acceleo launch configuration for the Generate_JavaStructures class. When I do this, I get (in the error log)
ERROR: Couldn't load class org.eclipse.gmt.modisco.java.generation.files.Generate_JavaS tructures from project org.eclipse.gmt.modisco.java.generation
WARN: org.eclipse.osgi.framework.internal.core.Framework$Duplicate BundleException: Bundle "org.eclipse.gmt.modisco.java.generation" version "0.8.0.v201003161136" has already been installed from: reference:file:plugins/org.eclipse.gmt.modisco.java.generati on_0.8.0.v201003161136.jar
b) again, use the import plugin wizard for the java.generation package , but launch the main class not with a Acceleo launch config but as standard java app (this should be equivalent to launching it from my own plugin) This yields:
org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Package with uri 'http://www.eclipse.org/acceleo/mtl/0.8.0' not found.
So, in a) I seem to not be allowed to have a copy of the .generation project in the workspace and somehow it cannot find the class, and in b), the acceleo version does not match, because the generate_javastructure.emtl which is provided in "MoDisco 0.8" in the "org.eclipse.gmt.modisco.java.generation" plugin carries the namespace "http://www.eclipse.org/acceleo/mtl/0.8.0", but the Acceleo version installed in Helios is actually 3.0.0 --.--
I do not know how to proceed. Can someone point out to me how to set up an Eclipse installation in which I can use the MoDisco java model generator? What is the preferred way of doing this?