Skip to main content



      Home
Home » Modeling » TMF (Xtext) » dsl maven build cannot resolve types defined in xtend
dsl maven build cannot resolve types defined in xtend [message #1753873] Fri, 10 February 2017 22:46 Go to next message
Eclipse UserFriend
Hi,

I met a compilation problem in building a dsl project, where the dsl code uses types from xtend code.

I experimented with the example project:
https://github.com/xtext/maven-xtext-example

Defined a Foo type in
example-project/src/main/java/my/pack/Foo.xtend
package my.pack
class Foo { }
Then changed the example-project/src/main/java/Super.hero file to:
hero Superman can FLY {
pirntln(new my.pack.Foo())
println("Hello I can fly!")
}

In mvn compile, I got the error:
ERROR:my.pack.Foo cannot be resolved. (file:/Users/paul/Downloads/maven-xtext-example/example-project/src/main/java/Super.hero line : 2 column : 17)

The pom adds both the xtend plugin and the dsl plugin. Are the maven plugins not able to perform this kind of build? I tried the same on the gradle version, it seems to work.

Thanks,
Paul
Re: dsl maven build cannot resolve types defined in xtend [message #1753874 is a reply to message #1753873] Sat, 11 February 2017 00:54 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

the problem is a different one.
the xtext maven plgin does not know xtend, the xtend maven plugin does not know hero

you need the xtext maven plugin to know xtend and remove the xtend maven plugin

<plugin>
				<groupId>org.eclipse.xtext</groupId>
				<artifactId>xtext-maven-plugin</artifactId>
				<version>${xtext-version}</version>
				<executions>
					<execution>
						<goals>
							<goal>generate</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<languages>
						<language>
							<setup>my.mavenized.HeroLanguageStandaloneSetup</setup>
							<outputConfigurations>
								<outputConfiguration>
									<outputDirectory>src/main/generated-sources/xtend/</outputDirectory>
								</outputConfiguration>
							</outputConfigurations>
						</language>
						
						<language>
							<setup>org.eclipse.xtend.core.XtendStandaloneSetup</setup>
							<outputConfigurations>
								<outputConfiguration>
									<outputDirectory>src/main/generated-sources/xtend/</outputDirectory>
								</outputConfiguration>
							</outputConfigurations>
						</language>
					
					</languages>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>my.mavenized.herolanguage</groupId>
						<artifactId>my.mavenized.herolanguage</artifactId>
						<version>1.0.0-SNAPSHOT</version>
					</dependency>
					<dependency>
						<groupId>org.eclipse.xtend</groupId>
						<artifactId>org.eclipse.xtend.core</artifactId>
						<version>${xtext-version}</version>
					</dependency>
				</dependencies>
			</plugin>

Re: dsl maven build cannot resolve types defined in xtend [message #1753913 is a reply to message #1753874] Sun, 12 February 2017 06:16 Go to previous message
Eclipse UserFriend
Thanks, that works : )
Previous Topic:Standalone executable with multiple DSLs
Next Topic:After Migration 2.10 -> 2.11. Cannot start application
Goto Forum:
  


Current Time: Wed Jul 23 16:23:40 EDT 2025

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

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

Back to the top