Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xtext/Xcore/Tycho dependencies
Xtext/Xcore/Tycho dependencies [message #1818189] Tue, 10 December 2019 02:15 Go to next message
Maged Elaasar is currently offline Maged ElaasarFriend
Messages: 23
Registered: September 2013
Junior Member
I create the Xtext (v2.19) projects with the following options:
- Eclipse plug-in
- Create feature
- Create Update site
- Preferred Build System: Gradle
- Build Language Server: Fat Jar
- Source Layout: Plain

This produces projects that have both Gradle and a Maven/Tycho builds. The Gradle build is where the LS FatJar is produced, and the Maven build is where the Updatesite is produced. This works good when the Xtext grammar generate/import Ecore models.

However, I switch the Xtext grammar to 'import' an Xcore model instead, I figured out how to get the Gradle build of the DSL project to work by adding the last dependency below:

dependencies {
	mwe2 'org.eclipse.emf:org.eclipse.emf.mwe2.launch'
	mwe2 "org.eclipse.xtext:org.eclipse.xtext.common.types:${xtextVersion}"
	mwe2 "org.eclipse.xtext:org.eclipse.xtext.xtext.generator:${xtextVersion}"
	mwe2 'org.eclipse.xtext:xtext-antlr-generator'
	// added for Xcore support
       mwe2 ('org.eclipse.emf:org.eclipse.emf.ecore.xcore:+'){
		exclude group: 'org.antlr', module: 'antlr-runtime'
	}
}


However, a similar change as follows to the pom.xml did not work:
				<dependencies>
					<dependency>
						<groupId>org.eclipse.emf</groupId>
						<artifactId>org.eclipse.emf.mwe2.launch</artifactId>
						<version>2.11.0</version>
					</dependency>
					<dependency>
						<groupId>org.eclipse.xtext</groupId>
						<artifactId>org.eclipse.xtext.common.types</artifactId>
						<version>${xtextVersion}</version>
					</dependency>
					<dependency>
						<groupId>org.eclipse.xtext</groupId>
						<artifactId>org.eclipse.xtext.xtext.generator</artifactId>
						<version>${xtextVersion}</version>
					</dependency>
					<dependency>
						<groupId>org.eclipse.xtext</groupId>
						<artifactId>org.eclipse.xtext.xbase</artifactId>
						<version>${xtextVersion}</version>
					</dependency>
					<dependency>
						<groupId>org.eclipse.xtext</groupId>
						<artifactId>xtext-antlr-generator</artifactId>
						<version>2.1.1</version>
					</dependency>
					<!-- Added for Xcore support -->
					<dependency>
						<groupId>org.eclipse.emf</groupId>
						<artifactId>org.eclipse.emf.ecore.xcore</artifactId>
						<version>1.11.0</version>
					</dependency>
				</dependencies>


I get the following error:

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (mwe2Launcher) on project: Execution mwe2Launcher of goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java failed: Plugin org.codehaus.mojo:exec-maven-plugin:1.6.0 or one of its dependencies could not be resolved: Failed to collect dependencies at org.codehaus.mojo:exec-maven-plugin:jar:1.6.0 -> org.eclipse.emf:org.eclipse.emf.ecore.xcore:jar:1.11.0 -> org.eclipse.emf:org.eclipse.emf.ecore:jar:[2.19.0,3.0.0): No versions available for org.eclipse.emf:org.eclipse.emf.ecore:jar:[2.19.0,3.0.0) within specified range -> [Help 1]


It seems to not able to resolve version 2.19 of the emf.ecore library used by Xcore, because Xtext uses version 2.12 instead.

I am not sure why the Gradle build works but not the Tycho one. Any idea?

Thanks in advance,
Maged Elaasar

[Updated on: Tue, 10 December 2019 02:27]

Report message to a moderator

Re: Xtext/Xcore/Tycho dependencies [message #1818190 is a reply to message #1818189] Tue, 10 December 2019 05:09 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13637
Registered: July 2009
Senior Member
Sure you did run maven with -U

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:How to run a java main class in an environment created with Xtext
Next Topic:Can we support both an LS and Eclipse Workbench at the same time?
Goto Forum:
  


Current Time: Sat Oct 24 15:11:11 GMT 2020

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

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

Back to the top