I started using xtext-maven-plugin.
I used the example from here: https: //github.com/svenefftinge/maven-xtext-example
I change the grammer a bit
grammar my.mavenized.HeroLanguage with org.eclipse.xtext.xbase.Xbase
..
Heros:
'package' name = QualifiedName
heros+=SuperHero*;
..
;
changed the test
package my.mavenized.herolanguage.tests
..
@RunWith(XtextRunner)
@InjectWith(HeroLanguageInjectorProvider)
class SimpleParsingTest {
@Inject extension ParseHelper<Heros>
@Test def void testParse() {
val heros = '''
package com.siemens.cp.chpmhs.emu.queues.t1.t2.t3.t4.tr.tr.tr.tr.tr.tr.tr.tr.tr.tr
hero superman can FLY
hero iceman can ICE
'''.parse
assertEquals(2, heros.heros.size)
}
}
running maven. all is perfect.
Now I changed the Super.hero in the example-projexct to
package com.siemens.cp.chpmhs.emu.queues.t1.t2.t3.t4.tr.tr.tr.tr.tr.tr.tr.tr.tr.tr
hero Superman can FLY {
println("Hello I can fly!")
}
Run mvn -X clean install
[ERROR] Failed to execute goal org.eclipse.xtext:xtext-maven-plugin:2.5.0:generate (default) on project example-project: Execution default of goal org.eclipse.xtext:xtext-maven-plugin:2.5.0:generate failed: 23 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.xtext:xtext-maven-plugin:2.5.0:generate (default) on project example-project: Execution default of goal org.eclipse.xtext:xtext-maven-plugin:2.5.0:generate failed: 23
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal org.eclipse.xtext:xtext-maven-plugin:2.5.0:generate failed: 23
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 23
at org.eclipse.emf.common.util.URI$URIPool$FileAccessUnit.reset(URI.java:1583)
at org.eclipse.emf.common.util.Pool.doIntern(Pool.java:963)
I have now idea where to look. My projekt has a deep package structure so it would be realy nice to find a way to avoid the exception.
Thanks