Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Unable to create Eclipse Product from the sample MyDsl projects
Unable to create Eclipse Product from the sample MyDsl projects [message #1844460] Tue, 14 September 2021 13:30 Go to next message
Franck De Bruijn is currently offline Franck De BruijnFriend
Messages: 7
Registered: July 2013
Junior Member
Hi,

I try to create an Eclipse product from the standard example DSL by using the wizards in Eclipse to create an XTEXT project.

I create the mydsl projects with the options 'Eclipse plug-in', 'Create Feature', 'Create Update Site', 'Testing Support', 'Maven', 'None' and 'Plain' (see also the attached picture wizard.png).

After I run the MWE2 workflow, I can then run the Eclipse application from Eclipse (Run As > Eclipse Application).

The maven build successfully builds the feature and the update site. I have been able to install the newly created feature into a vanilla Eclipse application.

So, that all works nicely out-of-the-box (many thanks for that, by the way, really appreciated).

Now my final step is to create an Eclipse product. I have followed a bunch of books, tutorials (Vogella) and blogs (https://kthoms.wordpress.com/2010/11/12/setting-up-a-rcp-product-for-a-dsl/) and also tried downloading all kinds of projects from GitHub, but I don't seem to get it working. I have the feeling that all this information has become outdated.

As a last resort I tried to compile an Eclipse product configuration by hand, but that resulted in dependency problems (when I chose 'Features', I could not include the google plugins; when I chose 'Plug-ins' I drowned in the dependencies).

Is there anyone who could highlight the steps I need to take to get this to work? Or point me to some actual GitHub repository where I can have a look at?

I am using Eclipse 2021-06.

Any help is appreciated!
Many thanks,
Franck
  • Attachment: wizard.png
    (Size: 26.38KB, Downloaded 39 times)
Re: Unable to create Eclipse Product from the sample MyDsl projects [message #1844462 is a reply to message #1844460] Tue, 14 September 2021 13:36 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

My blog post can be outdated, the general approach will still be valid. I apologize that I don't have the time to update it.

I hope you are in general familiar with building RCP products.

Maybe you start first setting up a build process for a vanilla feature-based RCP product. Once you get that running you can add the DSL feature to it, potentially add missing dependencies and it should work.

Re: Unable to create Eclipse Product from the sample MyDsl projects [message #1844463 is a reply to message #1844462] Tue, 14 September 2021 13:38 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14349
Registered: July 2009
Senior Member
you may check https://github.com/cdietrich/xtext-maven-example

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
Re: Unable to create Eclipse Product from the sample MyDsl projects [message #1844464 is a reply to message #1844462] Tue, 14 September 2021 13:42 Go to previous messageGo to next message
Franck De Bruijn is currently offline Franck De BruijnFriend
Messages: 7
Registered: July 2013
Junior Member
Thanks Karsten, I will try that.

I do not have a lot of experience with it ... But let's see.
Re: Unable to create Eclipse Product from the sample MyDsl projects [message #1844466 is a reply to message #1844463] Tue, 14 September 2021 14:09 Go to previous messageGo to next message
Franck De Bruijn is currently offline Franck De BruijnFriend
Messages: 7
Registered: July 2013
Junior Member
I followed your link Christian. I already did that, but tried it again.

Actually it worked! When I ran the maven clean verify on the releng pom.xml I got an Eclipse build out. With this Eclipse build I could nicely create a .mydsl file and see code completion and such. Thanks.

However, within Eclipse it looks not so good (see attached picture). Lots of complaints on the pom.xmls (plugin execution not covered by lifecycle configuration ...)

But I have now a starting point, let's see if I can make this to work for myself now. Thanks. I will post my findings below in this post if anyone is interested.
Re: Unable to create Eclipse Product from the sample MyDsl projects [message #1844472 is a reply to message #1844466] Tue, 14 September 2021 16:08 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14349
Registered: July 2009
Senior Member
Then you either need to install additi8nal m2e connectors to your eclipse
(There should be a Quickfix)
Or simply ignore them
Or add exclusions to Pom

But these errors are not related to your problem of building a product


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
Re: Unable to create Eclipse Product from the sample MyDsl projects [message #1844551 is a reply to message #1844472] Thu, 16 September 2021 13:48 Go to previous message
Franck De Bruijn is currently offline Franck De BruijnFriend
Messages: 7
Registered: July 2013
Junior Member
Thanks for both your support Christian and Karsten. Highly appreciated. With your help I have been able to get this to work.

Maybe other people stumble across the same problems I encountered. Below a list of steps that I took to get this to work. Maybe it is useful.

  1. Download/Install 'Eclipse IDE for Java and DSL Developers' from https://www.eclipse.org/downloads/packages/. Start with an empty workspace.
  2. Install the Eclipse plugin 'Tycho Project Configurations' from SonaType, Inc. Needed later to prevent errors in the maven pom.xml files.
  3. Create an XTEXT project with all the default settings (org.xtext.example.mydsl.MyDsl). On the 2nd page select the options 'Eclipse plug-in', 'Create Feature', 'Create Update Site', 'Preferred Build System = Maven', 'Build Language Server = None', 'Source Layout = Plain'.
  4. Create a general project 'org.xtext.example.mydsl.product' in the location <path to workspace>/org.xtext.example.mydsl.parent/org.xtext.example.mydsl.product.
  5. Within the 'product' project, create the product configuration file 'org.xtext.example.mydsl.product.product' and populate it with the content as listed below in this post.
  6. Within the 'product' project, create the maven configuration file 'pom.xml' and populate it with the content as listed below in this post.
  7. In the pom.xml of the project 'org.xtext.example.mydsl.parent' add 'org.xtext.example.mydsl.product' in the <modules> section below the module 'org.xtext.example.mydsl.repository'.
  8. In the same pom.xml as the previous step, add Eclipse to the list of repositories (within the <repositories> tag), like this (the url should match the repository location in the org.xtext.example.mydsl.target.target file):
    <repository>
    <id>eclipse</id>
    <url>https://download.eclipse.org/releases/2021-03</url>
    <layout>p2</layout>
    </repository>
  9. Run the pom.xml of the project 'org.xtext.example.mydsl.parent' with the goals 'clean verify'
  10. If all goes well (you should see 'SUCCESS'), refresh your workspace. No errors should popup. You can fetch your product from 'org.xtext.example.mydsl.product\target\products\org.xtext.example.mydsl.product\win32\win32\x86_64'

NOTE: You should also not forget to change the 'Plug-in Development > Target Platform' in your preferences to 'org.xtext.example.mydsl.target'.

It's quite simple, really, once you know it ...

Cheers,
Franck

Product configuration file:

<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>

<product name="XTEXT Example DSL" uid="org.xtext.example.mydsl.product" id="org.eclipse.platform.ide" application="org.eclipse.ui.ide.workbench" version="1.0.0.qualifier" useFeatures="true" includeLaunchers="true">

   <configIni use="default">
   </configIni>

   <launcherArgs>
      <vmArgs>-Xms1024m
-Xmx2048m
      </vmArgs>
      <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
      </vmArgsMac>
   </launcherArgs>

   <launcher>
      <win useIco="false">
         <bmp/>
      </win>
   </launcher>

   <vm>
   </vm>

   <plugins>
   </plugins>

   <features>
      <feature id="org.xtext.example.mydsl.feature" version="1.0.0.qualifier"/>
      <feature id="org.eclipse.platform"/>
      <feature id="org.eclipse.help"/>
      <feature id="org.eclipse.equinox.p2.core.feature"/>
      <feature id="org.eclipse.equinox.p2.extras.feature"/>
      <feature id="org.eclipse.equinox.p2.user.ui"/>
      <feature id="org.eclipse.equinox.p2.rcp.feature"/>
   </features>

   <configurations>
      <plugin id="org.apache.felix.scr" autoStart="true" startLevel="2" />
      <plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="4" />
      <plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
      <plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
      <plugin id="org.eclipse.update.configurator" autoStart="true" startLevel="4" />
   </configurations>

</product>


Maven Configuration File:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>org.xtext.example.mydsl</groupId>
		<artifactId>org.xtext.example.mydsl.parent</artifactId>
		<version>1.0.0-SNAPSHOT</version>
	</parent>

	<artifactId>org.xtext.example.mydsl.product</artifactId>
	<packaging>eclipse-repository</packaging>
	
	<build>
		<plugins>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-p2-director-plugin</artifactId>
				<version>${tycho-version}</version>
				<executions>
					<execution>
						<goals>
							<goal>materialize-products</goal>
						</goals>
						<id>materialize-products</id>
					</execution>
					<execution>
						<goals>
							<goal>archive-products</goal>
						</goals>
						<id>archive-products</id>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
Previous Topic:Reference model elements from target platform
Next Topic:Label Provider not being invoked
Goto Forum:
  


Current Time: Wed Sep 28 23:49:03 GMT 2022

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

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

Back to the top