Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » XTend integration within maven
XTend integration within maven [message #1407563] Tue, 12 August 2014 23:42 Go to next message
Julien Delange is currently offline Julien DelangeFriend
Messages: 82
Registered: October 2011
Member
Hello,

I have a xtext project that uses xtend for handling different aspects of my language (scoping, validation, etc). When compiling with maven, it complains that it does not find the java files generated from xtend.

How can I integrate xtend in my maven build and automatically generate the class file from the xtend code? I tried to look at any documentation but did not find amything on that topic.

Thanks for any help and/or useful pointers.

Julien.
Re: XTend integration within maven [message #1407641 is a reply to message #1407563] Wed, 13 August 2014 05:20 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14664
Registered: July 2009
Senior Member
Hi,

the xtend-maven-plugin should do the trick

https://www.eclipse.org/xtend/download.html
https://github.com/cdietrich/xtext-maven-example
https://github.com/xtext-dev/maven-xtext-example/




Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: XTend integration within maven [message #1407758 is a reply to message #1407641] Wed, 13 August 2014 11:30 Go to previous messageGo to next message
Julien Delange is currently offline Julien DelangeFriend
Messages: 82
Registered: October 2011
Member
Thanks a lot I will give a try!
Re: XTend integration within maven [message #1407869 is a reply to message #1407641] Wed, 13 August 2014 17:04 Go to previous messageGo to next message
Julien Delange is currently offline Julien DelangeFriend
Messages: 82
Registered: October 2011
Member
Hello,

I tried to use the project example and the xtend files are generated. However, after, I run into several other issues (see below). That seems not directly caused by the change but still related to the xtend integration.

Any idea about why such a problem pops up now?

Thanks for any idea/suggestion!



[ERROR] Failed to execute goal org.eclipse.xtend:xtend-maven-plugin:2.6.2:compile (default) on project org.osate.xtext.aadl2: Execution default of goal org.eclipse.xtend:xtend-maven-plugin:2.6.2:compile failed: java.util.zip.ZipException: error in opening zip file -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.xtend:xtend-maven-plugin:2.6.2:compile (default) on project org.osate.xtext.aadl2: Execution default of goal org.eclipse.xtend:xtend-maven-plugin:2.6.2:compile failed: java.util.zip.ZipException: error in opening zip file
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(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:622)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal org.eclipse.xtend:xtend-maven-plugin:2.6.2:compile failed: java.util.zip.ZipException: error in opening zip file
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: org.eclipse.emf.common.util.WrappedException: java.util.zip.ZipException: error in opening zip file
at org.eclipse.xtext.mwe.PathTraverser.traverseArchive(PathTraverser.java:72)
at org.eclipse.xtext.mwe.PathTraverser.findAllResourceUris(PathTraverser.java:49)
at org.eclipse.xtext.mwe.PathTraverser.resolvePathes(PathTraverser.java:35)
at org.eclipse.xtend.core.compiler.batch.XtendBatchCompiler.loadXtendFiles(XtendBatchCompiler.java:414)
at org.eclipse.xtend.core.compiler.batch.XtendBatchCompiler.compile(XtendBatchCompiler.java:381)
at org.eclipse.xtend.maven.AbstractXtendCompilerMojo.compile(AbstractXtendCompilerMojo.java:109)
at org.eclipse.xtend.maven.XtendCompile.compileSources(XtendCompile.java:66)
at org.eclipse.xtend.maven.XtendCompile.internalExecute(XtendCompile.java:59)
at org.eclipse.xtend.maven.AbstractXtendMojo.execute(AbstractXtendMojo.java:39)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
... 20 more
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:132)
at java.util.zip.ZipFile.<init>(ZipFile.java:169)
at org.eclipse.xtext.mwe.PathTraverser.traverseArchive(PathTraverser.java:57)
... 29 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :org.osate.xtext.aadl2

Re: XTend integration within maven [message #1407890 is a reply to message #1407869] Wed, 13 August 2014 18:12 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14664
Registered: July 2009
Senior Member
did you run this with -X option. it should tell you which zipfile is broken.
you could delete it from your maven rep and retry.

which jdk do you use.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: XTend integration within maven [message #1407909 is a reply to message #1407890] Wed, 13 August 2014 19:14 Go to previous messageGo to next message
Julien Delange is currently offline Julien DelangeFriend
Messages: 82
Registered: October 2011
Member
I tried with the -X and -e switches but it does not provide any useful information.
I am using using openjdk 7 on debian.

Is there any special zip file and/or package required by maven for xtend?
Re: XTend integration within maven [message #1408042 is a reply to message #1407909] Thu, 14 August 2014 05:20 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14664
Registered: July 2009
Senior Member
Hi,

no,

it basically uses the classpath. it schould be printed in the log.
are you sure there is no root cause for the exception???

is so the only chance i see is to clear the maven repo and hope that this will help.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: XTend integration within maven [message #1408265 is a reply to message #1408042] Thu, 14 August 2014 16:19 Go to previous message
Julien Delange is currently offline Julien DelangeFriend
Messages: 82
Registered: October 2011
Member
Follow up on that. Some xtend classes seems to compile well while some others fails.
In my Eclipse environment, everything seems to be ok. But not with xtend. This is the trace I got.
Any idea about how can I trace the reason why it does not build?

Thanks.


[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.21.0:compile (default-compile) on project org.osate.xtext.aadl2: Compilation failure: Compilation failure:
[ERROR] /tmp/osate/core/org.osate.xtext.aadl2/src/org/osate/xtext/aadl2/Aadl2RuntimeModule.java:[43]
[ERROR] import org.osate.xtext.aadl2.scoping.Aadl2ScopeProviderDelegate;
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] The import org.osate.xtext.aadl2.scoping.Aadl2ScopeProviderDelegate cannot be resolved
[ERROR] 1 problem (1 error)
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.21.0:compile (default-compile) on project org.osate.xtext.aadl2: Compilation failure
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
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(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: copied.org.apache.maven.plugin.CompilationFailureException: Compilation failure
at copied.org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:418)
at org.eclipse.tycho.compiler.AbstractOsgiCompilerMojo.execute(AbstractOsgiCompilerMojo.java:224)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :org.osate.xtext.aadl2


Previous Topic:[SOLVED] How to push on Gerrit
Next Topic:completion proposal not work for nested XExpression
Goto Forum:
  


Current Time: Tue Apr 16 08:13:25 GMT 2024

Powered by FUDForum. Page generated in 0.34682 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top