Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to let Tycho resolve dependencies in xtext-maven-plugin?
How to let Tycho resolve dependencies in xtext-maven-plugin? [message #1786600] Tue, 08 May 2018 08:15 Go to next message
Balz Guenat is currently offline Balz GuenatFriend
Messages: 21
Registered: January 2018
Junior Member
Hello

I have two workspaces. In one, I am developing my DSL and use Maven and Tycho to build the Eclipse plug ins and language setups. The plug ins are deployed to a local p2 repository. In the other Workspace, I have the aforementioned plug ins installed, write my DSL code and, again, build with Maven and Tycho.

Now, Eclipse has the DSL plug ins installed and thus can compile the DSL code. However, Maven/Tycho cannot, as the xtext-maven-plugin relies on Maven alone to resolve its dependencies on the language setup.

I can get the resolution to work if I install the language setups from the first workspace into a shared maven repository (e.g. the local repo). I don't like this, as it means that Eclipse and Maven resolve the same dependency of the same project in different ways. Also, if I want to build the DSL projects independently, I'd have to set up an actual shared Maven repo.

Is there a way to use the same plug in Eclipse uses in the xtext-maven-plugin? Or is it unreasonable to want that?
Re: How to let Tycho resolve dependencies in xtext-maven-plugin? [message #1786601 is a reply to message #1786600] Tue, 08 May 2018 09:05 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6111
Registered: July 2009
Senior Member
Hi

Most Eclipse projects now build using Maven and Tycho and use many plugins that are not available from Maven. It is so standard that I kind of forget how I do it. I think it is the target definition that specifies what plugins/features to load

e.g. set the target definition variants at http://git.eclipse.org/c/ocl/org.eclipse.ocl.git/tree/releng/org.eclipse.ocl.releng.tycho/targetPlatforms

Regards

Ed Willink
Re: How to let Tycho resolve dependencies in xtext-maven-plugin? [message #1786604 is a reply to message #1786601] Tue, 08 May 2018 09:18 Go to previous messageGo to next message
Balz Guenat is currently offline Balz GuenatFriend
Messages: 21
Registered: January 2018
Junior Member
My target definition already includes the packages required in xtext-maven-plugin and they work in all other places where they are required. The xtext-maven-plugin is the exception.
Re: How to let Tycho resolve dependencies in xtext-maven-plugin? [message #1786606 is a reply to message #1786604] Tue, 08 May 2018 09:55 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6111
Registered: July 2009
Senior Member
Hi

Ok. Sorry I misunderstood your problem since I have never used/needed to use/had any knowledge of the xtext-maven-plugin.

For my projects I distinguish between a developer time manual/locally automated generation of *.java files, so that a user can just load the java and rely on the Eclipse builder to finish off. The Xtend builder, while not perfect, allows *.xtend to be treated as primary sources. However other conversions such as from *.xtext or *.ecore let alone from *.unusuallanguage to Java often have inadequate/no builders and cause a new user significant installation/activation difficulties. *.java as the 'distributed source' available from GIT defers these problems until the new user wants to modify the true sources.

I suspect that you are being too ambitious in your automation. Xtext compatibility across versions has not always been perfect and so you may inflict breakages on your users if you auto-build. I strongly recommend that occasional activities such as Xtext tooling generation, EMF model generation, and Javadoc/documentation generation are performed by manually triggered automation. I use compound MWE2 scripts. This may make your need for xtext-maven-plugin go away.

Regards

Ed Willink
Re: How to let Tycho resolve dependencies in xtext-maven-plugin? [message #1786608 is a reply to message #1786606] Tue, 08 May 2018 10:26 Go to previous message
Balz Guenat is currently offline Balz GuenatFriend
Messages: 21
Registered: January 2018
Junior Member
I think you misunderstand the purpose of the xtext-maven-plugin. It is not used to build the language tooling from grammar, xtend code, etc. As you suggest, I am using MWE2 scripts (and the appropriate maven plugins for that) to do that. That part works.

The xtext-maven-plugin is used to compile/transpile code written in your DSL. It takes as input the code and a previously built language setup (aka. langauge tooling) and applies that to the code, resulting in generated .java files or what have you. This is the part that doesn't work (as desired).

Hope that clears things up.
Previous Topic:Xtext Lexer and Parser
Next Topic:problem launching eclipse runtime and generating code
Goto Forum:
  


Current Time: Fri Nov 16 02:55:15 GMT 2018

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

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

Back to the top