Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » deploy xtext language as maven artifact
deploy xtext language as maven artifact [message #1758472] Wed, 29 March 2017 02:42 Go to next message
paul lu is currently offline paul luFriend
Messages: 43
Registered: April 2013
Member
Hi,

I tried deploying an xtext language as maven artifacts, but the project that uses the DSL cannot be compiled by maven, .

I experiemented with https://github.com/xtext/maven-xtext-example.
1. Added the following distribution configuration in my.mavenized.herolanguage.releng/pom.xm:
<distributionManagement>
<repository>
<id>internal.repo</id>
<name>Local repo</name>
<url>file:///Users/paul/Downloads/maven-xtext-example/deployed</url>
</repository>
</distributionManagement>

2. run : mvn deploy under my.mavenized.herolanguage.releng
3. The deploy directory (/Users/paul/Downloads/maven-xtext-example/deployed) looks like:
└── my
└── mavenized
└── herolanguage
├── my.mavenized.herolanguage
│   ├── 1.0.0-SNAPSHOT
│   │   ├── maven-metadata.xml
│   │   ├── maven-metadata.xml.md5
│   │   ├── maven-metadata.xml.sha1
│   │   ├── my.mavenized.herolanguage-1.0.0-20170329.022618-1-p2artifacts.xml
│   │   ├── my.mavenized.herolanguage-1.0.0-20170329.022618-1-p2artifacts.xml.md5
│   │   ├── my.mavenized.herolanguage-1.0.0-20170329.022618-1-p2artifacts.xml.sha1
│   │   ├── my.mavenized.herolanguage-1.0.0-20170329.022618-1-p2metadata.xml
│   │   ├── my.mavenized.herolanguage-1.0.0-20170329.022618-1-p2metadata.xml.md5
│   │   ├── my.mavenized.herolanguage-1.0.0-20170329.022618-1-p2metadata.xml.sha1
│   │   ├── my.mavenized.herolanguage-1.0.0-20170329.022618-1.jar
│   │   ├── my.mavenized.herolanguage-1.0.0-20170329.022618-1.jar.md5
│   │   ├── my.mavenized.herolanguage-1.0.0-20170329.022618-1.jar.sha1
│   │   ├── my.mavenized.herolanguage-1.0.0-20170329.022618-1.pom
│   │   ├── my.mavenized.herolanguage-1.0.0-20170329.022618-1.pom.md5
│   │   └── my.mavenized.herolanguage-1.0.0-20170329.022618-1.pom.sha1

4. in exampl-project, I added the deploy directory in the pom:
+ <repositories>
+ <repository>
+ <id>localrepository</id>
+ <url>file:///Users/paul/Downloads/maven-xtext-example/deployed</url>
+ </repository>
+ </repositories>

5. Then in example-project, run: mvn compile, the error is:
[ERROR] Failed to execute goal org.eclipse.xtext:xtext-maven-plugin:2.11.0:generate (default) on project example-project: Execution default of goal org.eclipse.xtext:xtext-maven-plugin:2.11.0:generate failed: Plugin org.eclipse.xtext:xtext-maven-plugin:2.11.0 or one of its dependencies could not be resolved: Could not find artifact my.mavenized.herolanguage:my.mavenized.herolanguage:jar:1.0.0-SNAPSHOT ->

Is it the appropriate way of deploying a xtext language ?
I was able to compile the example if I install the language locally by exectuing : mvn install in the releng directory.
One difference I note is the local jar in ~/.m2 is
~/.m2/repository/my/mavenized/herolanguage/my.mavenized.herolanguage/1.0.0-SNAPSHOT/my.mavenized.herolanguage-1.0.0-SNAPSHOT.jar
as compared to the deployed jar
my.mavenized.herolanguage-1.0.0-20170329.022618-1.jar

Thanks

Re: deploy xtext language as maven artifact [message #1758479 is a reply to message #1758472] Wed, 29 March 2017 06:58 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14067
Registered: July 2009
Senior Member
Hi,

unfortunately i cannot reproduce this

maybe you are missing this:

	<pluginRepositories>
		<pluginRepository>
			<id>localrepository2</id>
			<name>Local repo</name>
			<url>file:///Users/dietrich/Downloads/maven-xtext-example/deployed</url>
		</pluginRepository>
	</pluginRepositories>


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: deploy xtext language as maven artifact [message #1758483 is a reply to message #1758479] Wed, 29 March 2017 08:13 Go to previous message
paul lu is currently offline paul luFriend
Messages: 43
Registered: April 2013
Member
Oh, that's the part I missed. It works now.

Thank you !
Previous Topic:XbaseCompiler exception when compiling simple XExpressions
Next Topic:Parsing XBase in the inferrer
Goto Forum:
  


Current Time: Sun Sep 26 16:47:48 GMT 2021

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

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

Back to the top