Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Maven generate-sources for two grammars
Maven generate-sources for two grammars [message #1782041] Fri, 16 February 2018 07:12 Go to next message
Eclipse UserFriend
Hi all.
I'm trying to test my two plug-ins locally before release them, SDL and EDL. In SDL the service contracts is defined and some source code are generated. The EDL reads elements defined in SDL and generate Java source code. I installed the two plug-ins in my Eclipse (from our update site) and they are working fine in an example project, generating all the code as expected.
But, our generated sources in Eclipse are not commited on Git, because they are generated calling maven generate-sources during the release process by our CI. So, I'm testing maven generate-sources for my example project locally. But I'm getting an error when the EDL plug-in tries to generate souces through maven. It does not find any classes from the SDL grammar that is used by EDL. I saw that don't have SDL jars in EDL plug-in, should have?
I attacched some files such as the EDL plug-in content, Maven logs, the pom.xml of my example project with the configurations.

I already tryed to initialize the SDLStandaloneSetup.doSetup inside the EDLStandaloneSetup like I done in my unit tests, but here it is not working.

I'm grateful if anyone can give me some tips.
Re: Maven generate-sources for two grammars [message #1782042 is a reply to message #1782041] Fri, 16 February 2018 07:15 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

looing at the pom i can see that you have only one standalonesetup/language section there. why?

Re: Maven generate-sources for two grammars [message #1782045 is a reply to message #1782042] Fri, 16 February 2018 07:36 Go to previous messageGo to next message
Eclipse UserFriend
Hi Christian.
The SDL grammar has its own custom maven pojo, as you can see in a plugin section above in the pom.

But for the EDL plugin section I thought I need only call the EDL StandaloneSetup. Althought I already tried creating two language sections, the first for SDL and the second for EDL, but I got also errors when it calls SDL StandaloneSetup. So I removed the SDL language section.
Re: Maven generate-sources for two grammars [message #1782047 is a reply to message #1782045] Fri, 16 February 2018 07:44 Go to previous messageGo to next message
Eclipse UserFriend
hmmm i dont think that will work.
i think the whole of language sections determines which files will be looked at and which not.
=> one call to the xtext maven plugin
=> multiple lanuages sections
Re: Maven generate-sources for two grammars [message #1782064 is a reply to message #1782047] Fri, 16 February 2018 12:07 Go to previous messageGo to next message
Eclipse UserFriend
I changed my pom accordly, with one call to xtext maven plugin with two language sections. Now, no erros happens, however no sources are generated. The maven log and the changed pom are attached.
Re: Maven generate-sources for two grammars [message #1782076 is a reply to message #1782064] Fri, 16 February 2018 13:53 Go to previous messageGo to next message
Eclipse UserFriend
no idea sure [INFO] File 'C:\mk\workspace\senior\entidades\src\main\java' is missing. Skipping. is correct
Re: Maven generate-sources for two grammars [message #1782077 is a reply to message #1782076] Fri, 16 February 2018 14:12 Go to previous message
Eclipse UserFriend
Now it is working.
Thank you Christian for your tip about using multiples language sections, this was very useful to solve the issue. The custom SDL maven plug-in must be called in a own plugin section. And the other hand, in the xtext maven plug-in, I created two languages sections, one for SDLStandaloneSetup and other for EDLStandaloneSetup. I also needed to add the SDL dependence, and other specific SDL dependence. A litle ugly, but it is working now.
The final pom with the configurations is attached.

Thank you for the help.
  • Attachment: pom.xml
    (Size: 3.90KB, Downloaded 234 times)
Previous Topic:Reuse Java Code of Inferred Xbase in Another IGenerator
Next Topic:Creating hyperlinks in Xtext editor
Goto Forum:
  


Current Time: Thu Jul 24 00:09:11 EDT 2025

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

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

Back to the top