Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Solving Maven dependency between two Xtext projects for production
Solving Maven dependency between two Xtext projects for production [message #1781184] Fri, 02 February 2018 11:20 Go to next message
Márcio Koch is currently offline Márcio KochFriend
Messages: 46
Registered: August 2013
Member
Hi guys.
I Have a new Xtext project A that uses (manipulates entities) from another existing Xtext project B. I imported project B together with my new project A in Eclipse. After, in project A, I configured the dependence for project B in MANIFEST.MF file and I also added project B in the "referencedResource" in the "StandardLanguage" section in the mwe2 file. In the development environment at my computer all works fine. But now I trying to release in Maven repository my new plug-in of project A, that depends on project B. However, I got an error in Maven because it cannot resolve dependencies for project B. I would like some hint of how is the right way to solve this dependence issue to put my new plug-in in production.
Regards,
Márcio Koch.
Re: Solving Maven dependency between two Xtext projects for production [message #1781185 is a reply to message #1781184] Fri, 02 February 2018 11:24 Go to previous messageGo to next message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 12178
Registered: July 2009
Senior Member
is it during workflow execution or during compile?
is the project b built in the same maven built? if not how did you adjust target platform and pom?
did you adapt the maven exec call in the pom?


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Solving Maven dependency between two Xtext projects for production [message #1781189 is a reply to message #1781185] Fri, 02 February 2018 11:48 Go to previous messageGo to next message
Márcio Koch is currently offline Márcio KochFriend
Messages: 46
Registered: August 2013
Member
Thanks for the quickly answer.
is it during workflow execution or during compile?
R: I was only trying to run the unit tests: mvn clean test

is the project b built in the same maven built?
R: I think not.

if not how did you adjust target platform and pom?
R: I did nothing in this itens yet.

did you adapt the maven exec call in the pom?
R: No, I didn't. I do not know what I should do here.
Re: Solving Maven dependency between two Xtext projects for production [message #1781190 is a reply to message #1781189] Fri, 02 February 2018 11:59 Go to previous messageGo to next message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 12178
Registered: July 2009
Senior Member
the problem is: there are 10000000000 possibilities
so with no information where dsl b is and how it is built and how it is published to be consumed from dsl a i cannot really help.


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Solving Maven dependency between two Xtext projects for production [message #1781197 is a reply to message #1781190] Fri, 02 February 2018 13:06 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 607
Registered: July 2009
Location: Dortmund, Germany
Senior Member

When the both DSLs are not running within the same Maven build, you'll have to install DSL a with "mvn install". Otherwise no library can be resolved through the local repository.

If that's not the problem we need more information and best reproducible examples.
Re: Solving Maven dependency between two Xtext projects for production [message #1781434 is a reply to message #1781197] Wed, 07 February 2018 10:12 Go to previous messageGo to next message
Márcio Koch is currently offline Márcio KochFriend
Messages: 46
Registered: August 2013
Member
Hi, the existing DSL "b" that is already in production and is used by new DSL "a" has its own maven build and has its own updatesite. So, should I add DSL "b" in the "Target Definition" of project DSL "a" with a specific release version of DSL "b"? Both DSL "a" and "b" should work together. If some developer works with a diferent version of DSL "b" that has been packed into the DSL "a", it will works? Knowing that DSL "a" is used to configure entities defined in DSL "b".
Thanks for the help.
Re: Solving Maven dependency between two Xtext projects for production [message #1781438 is a reply to message #1781434] Wed, 07 February 2018 10:48 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 607
Registered: July 2009
Location: Dortmund, Germany
Senior Member

Yes, you need to add b's p2 repository URL to the target definition of a.
You can only have one version of b installed. If developers need a changed version of b, the build of a must use that version in the target.
Re: Solving Maven dependency between two Xtext projects for production [message #1781442 is a reply to message #1781438] Wed, 07 February 2018 11:36 Go to previous messageGo to next message
Márcio Koch is currently offline Márcio KochFriend
Messages: 46
Registered: August 2013
Member
Currentlly, my DSL "b" is in xtext version 2.9.1 and my new DSL "a" is in xtext version 2.10.0. Can this be a problem?
Re: Solving Maven dependency between two Xtext projects for production [message #1781444 is a reply to message #1781442] Wed, 07 February 2018 11:39 Go to previous messageGo to next message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 12178
Registered: July 2009
Senior Member
you did not post a error message but yes that could be a problem

Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Solving Maven dependency between two Xtext projects for production [message #1781448 is a reply to message #1781444] Wed, 07 February 2018 12:09 Go to previous messageGo to next message
Márcio Koch is currently offline Márcio KochFriend
Messages: 46
Registered: August 2013
Member
The error is attached. The problem is required dependencie of DSL "b", it needs org.eclipse.emf.ecore 2.11.1 and DSL "a" has org.eclipse.emf.ecore 2.11.0 version.

Maybe is it better to have the two DSLs in the same plug-in?
Re: Solving Maven dependency between two Xtext projects for production [message #1781449 is a reply to message #1781448] Wed, 07 February 2018 12:13 Go to previous messageGo to next message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 12178
Registered: July 2009
Senior Member
no you should just align the dependencies

Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Solving Maven dependency between two Xtext projects for production [message #1781469 is a reply to message #1781449] Wed, 07 February 2018 15:15 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 607
Registered: July 2009
Location: Dortmund, Germany
Senior Member

yes, the error is just an inconsistent target platform definition here. and maybe sdl.model makes wrong assumptions on the lower bound of org.eclipse.emf.ecore. You may rethink the lower bound constraint here.
Re: Solving Maven dependency between two Xtext projects for production [message #1781478 is a reply to message #1781469] Wed, 07 February 2018 17:31 Go to previous messageGo to next message
Márcio Koch is currently offline Márcio KochFriend
Messages: 46
Registered: August 2013
Member
I have succeeded in adding the DSL "b" in the DSL "a" in the Target Definition. But now when I run the .mwe2 of DSL "a", I get an error such as attached, seems that does not can parse .xcore files. Could it be missing some dependency yet?
Re: Solving Maven dependency between two Xtext projects for production [message #1781483 is a reply to message #1781478] Wed, 07 February 2018 18:16 Go to previous message
Márcio Koch is currently offline Márcio KochFriend
Messages: 46
Registered: August 2013
Member
I solved the problem by adding some more dependencies: org.eclipse.emf.ecore and org.eclipse.emf.ecore.xcore into the MANIFEST.MF. Now it works fine.
Thankyou very much to both.

[Updated on: Wed, 07 February 2018 18:31]

Report message to a moderator

Previous Topic:Is there a plan for the next Xtext Summit?
Next Topic:Unit Test with cross-references to an external emf model
Goto Forum:
  


Current Time: Wed Aug 15 12:44:35 GMT 2018

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

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

Back to the top