Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » using the xtext-maven-plugin
using the xtext-maven-plugin [message #1438785] Mon, 06 October 2014 13:38 Go to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
Hi

In one of my DSLs, call it MyDsl, I'd like to call the MyDsl generator
in the DSL test project with the xtext-maven-plugin, during the same
maven build, thus, following the tutorials, I tried something like

<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.dsl.MyDslStandaloneSetup</setup>
<outputConfigurations>
<outputConfiguration>
<outputDirectory>${basedir}/dsl-gen</outputDirectory>
</outputConfiguration>
</outputConfigurations>
</language>
</languages>
</configuration>
</plugin>

But the my.dsl.MyDslStandaloneSetup cannot be found

Caused by: java.lang.ClassNotFoundException: my.dsl.MyDslStandaloneSetup
at
org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at
org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:259)
at
org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:242)
at
org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:227)
at
org.eclipse.xtext.builder.standalone.LanguageAccessFactory.createLanguageAccess(LanguageAccessFactory.java:28)

Is it possible to do something like that or a previous maven install is
strictly required?

thanks in advance
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book


Re: using the xtext-maven-plugin [message #1439509 is a reply to message #1438785] Tue, 07 October 2014 08:15 Go to previous messageGo to next message
Dennis Huebner is currently offline Dennis HuebnerFriend
Messages: 257
Registered: July 2009
Senior Member

You have to add the runtime projects as a plugin dependency in:
			<plugin>
				<groupId>org.eclipse.xtext</groupId>
				<artifactId>xtext-maven-plugin</artifactId>
				<version>${xtend-version}</version>
....
				<dependencies>
					<dependency>
						<!-- add runtime project here -->
				 	</dependency>
				</dependencies>
			</plugin>



+Dennis Huebner

Get professional support from the Xtext committers at www.typefox.io
Re: using the xtext-maven-plugin [message #1439668 is a reply to message #1439509] Tue, 07 October 2014 11:36 Go to previous message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 07/10/2014 10:15, Dennis Huebner wrote:
> You have to add the runtime projects as a plugin dependency in:
> <plugin>
> <groupId>org.eclipse.xtext</groupId>
> <artifactId>xtext-maven-plugin</artifactId>
> <version>${xtend-version}</version>
> ...
> <dependencies>
> <dependency>
> <!-- add runtime project here -->
> </dependency>
> </dependencies>
> </plugin>

Hi Dennis

apparently I was doing something wrong in my case... it works correctly
on Stefan's example (I created a pull request with an example... it
might be useful: https://github.com/oehme/xtext-maven-example/pull/8)

cheers
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book


Previous Topic:Use ExecutableExtensionFactory direct from org.eclipse.xtext.ui Plugin
Next Topic:Restricting JvmTypeRef scope to elements implementing a certain interface
Goto Forum:
  


Current Time: Thu Apr 25 16:28:35 GMT 2024

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

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

Back to the top