Over a million developers have joined DZone.

Eclipse Maven Tycho Xtext Archetype

· DevOps Zone

The DevOps zone is brought to you in partnership with Sonatype Nexus. The Nexus suite helps scale your DevOps delivery with continuous component intelligence integrated into development tools, including Eclipse, IntelliJ, Jenkins, Bamboo, SonarQube and more. Schedule a demo today

Xtext comes with pretty good documentation, but if you want to automate the build for your little new DSL, you’re drifting into deep water. There is some documentation on the Net, but even if you are an advanced Maven user, it’s easy to get lost with the Tycho plugin.

That’s why I made a Maven Archetype that creates a standard multi-module Maven layout and that also includes a P2 repository project, which is missing when you use the standard Eclipse Xtext wizard.

If you just want to use the default settings, simply execute the following on the command line:

mvn archetype:generate \
  -DarchetypeGroupId=org.fuin.archetypes \
  -DarchetypeArtifactId=emt-xtext-archetype \

It will generate the following project structure:

|-- com.mycompany.mydsl.dsl
|-- com.mycompany.mydsl.repository
|-- com.mycompany.mydsl.sdk
|-- com.mycompany.mydsl.tests
|-- com.mycompany.mydsl.ui
`-- mydsl-test
.mydsl Maven parent project. [Maven project]
.mydsl.dsl Grammar and base classes for the DSL [Tycho 'eclipse-plugin']
.mydsl.repository Creates a P2 repository. [Tycho 'eclipse-repository']
.mydsl.sdk Eclipse feature project [Tycho 'eclipse-feature']
.mydsl.tests Unit test project. [Tycho 'eclipse-test-plugin']
.mydsl.ui UI related parts. [Tycho 'eclipse-plugin']
.mydsl-test Example DSL project. [Eclipse project]

When you start creating a real project, you should also add the other parameters that are available for the generate command.

For a full description of the archetype, just visit the project page on GitHub: https://github.com/fuinorg/emt-xtext-archetype

The DevOps zone is brought to you in partnership with Sonatype Nexus. Use the Nexus Suite to automate your software supply chain and ensure you're using the highest quality open source components at every step of the development lifecycle. Get Nexus today


Published at DZone with permission of Michael Schnell, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}