Home » Modeling » MoDisco » Java Code Generation with MoDisco
Java Code Generation with MoDisco [message #574730] |
Mon, 19 April 2010 19:35 |
Philip Mayer Messages: 30 Registered: July 2009 |
Member |
|
|
Dear all,
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?
Thanks,
Philip
|
|
|
Re: Java Code Generation with MoDisco [message #574758 is a reply to message #574730] |
Tue, 20 April 2010 12:23 |
Fabien Giquel Messages: 147 Registered: July 2009 |
Senior Member |
|
|
Hi Philip,
You were right in choosing Helios.
There are been some issue in M6 milestone build for MoDisco considering
changes delivered in Acceleo M6. Sorry, We will do better in M7 coming
soon (early may).
So i suggest the following steps :
- install Helios M6 + Acceleo v3.0.0 (just as you did)
- install MoDisco from nightly update site :
http://download.eclipse.org/modeling/gmt/modisco/updates/nig htly/
- from your plugin, add dependency to org.eclipse.emf.ecore and
org.eclipse.gmt.modisco.java.generation
- in your plugin code, use the Generate_JavaStructure class. The code
should look like this :
Generate_JavaStructures javaGenerator = new
Generate_JavaStructures(URI.createFileURI("C:/.../my.javaxmi "),
new File("C:/.../myOutputFolder"), new ArrayList<Object>());
javaGenerator.doGenerate(null);
You do not need to use the import plugin wizard for those steps. As you
noticed, there is some trouble when importing the plugin and using an
acceleo launcher.
Additionaly, an example is available in
org.eclipse.gmt.modisco.java.generation.tests project (JUnit test for
java generation) which can be retrieved from our SVN.
I hope everything will be alright now.
Best regards.
Le 19/04/2010 21:35, Philip Mayer a écrit :
> Dear all,
>
> 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?
>
> Thanks,
>
> Philip
----------------------------------------------------
Fabien GIQUEL
R&D Engineer
Mia-Software
rue Nina Simone
44000 NANTES
----------------------------------------------------
|
|
| | | |
Goto Forum:
Current Time: Fri Apr 19 16:37:06 GMT 2024
Powered by FUDForum. Page generated in 0.03436 seconds
|