I have an Acceleo-based generator that generates text files from UML classes. I want to run it on Obeo Designer. I created it in Obeo Designer 6.2. When I build and debug my application locally from Obeo, everything works fine.
But if I build my application using Maven and then install it on Obeo Designer as a plugin, then, whenever I try to generate a text file using my Acceleo-based generator, I get the following exception:
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1911)
at org.eclipse.emf.ecore.impl.EModelElementImpl.eObjectForURIFragmentSegment(EModelElementImpl.java:417)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject(ResourceImpl.java:774)...
I think, my issue is similar to this one: https://bugs.eclipse.org/bugs/show_bug.cgi?id=421341 The .emtl file, generated during Maven build, contains "%" which cannot be parsed during the execution of my generator and gives an exception. The .emtl file generated during local build (without Maven) does not have any "%" and works fine.
As far as I understood, the problem is that I try to execute my generator with EMF 2.8, and the version of EMF used for Maven build is (probably) 2.9. I cannot upgrade the version of EMF on Obeo Designer.
My question is: how can I avoid this issue? How can I say explicitly, which version of EMF should be used during Maven build of Acceleo generator? Or does it depend on the version of Acceleo?
For the Maven build of my generator I followed the instructions here: https://wiki.eclipse.org/Acceleo/Maven
Thanks in advance
Best regards
You should be able to use the org.eclipse.acceleo.maven.compatibility builder plug-in instead of org.eclipse.acceleo.maven; the compatibility version uses EMF 2.8 to workaround this issue.