Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Including Maven Dependencies on XText Eclipse Project
Including Maven Dependencies on XText Eclipse Project [message #1851925] Thu, 21 April 2022 18:05 Go to next message
Ben Holland is currently offline Ben HollandFriend
Messages: 34
Registered: April 2019
Member
Hi!

I am struggling to figure out how to include a Maven dependencies on a standard XText Eclipse project with Maven build support (hello world produced from the wizard).

Any hints?

Specifically I want to include Symja (algebra engine) from https://github.com/axkr/symja_android_library. The relevant POM files are:

<dependencies>
  <dependency>
    <groupId>org.matheclipse</groupId>
    <artifactId>matheclipse-core</artifactId>
    <version>2.0.0-SNAPSHOT</version>
  </dependency>
  <dependency>
    <groupId>org.matheclipse</groupId>
    <artifactId>matheclipse-gpl</artifactId>
    <version>2.0.0-SNAPSHOT</version>
  </dependency>
  <dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>2.0.0-alpha6</version>
  </dependency>
  <dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-simple</artifactId>
    <version>2.0.0-alpha6</version>
  </dependency>
  <dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-to-slf4j</artifactId>
    <version>2.17.2</version>
  </dependency>
</dependencies>

<repositories>
  <repository>
    <id>snapshots-repo</id>
    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    <releases>
      <enabled>false</enabled>
    </releases>
    <snapshots>
      <enabled>true</enabled>
    </snapshots>
  </repository>
</repositories>
Re: Including Maven Dependencies on XText Eclipse Project [message #1851926 is a reply to message #1851925] Thu, 21 April 2022 18:25 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14726
Registered: July 2009
Senior Member
You you mean a tycho based build for eclipse?
Then you can check out this feature

https://github.com/xtext/xtext-orbit-replacement/blob/ce72ed871500c44c5c2f60ed75b43901291d62ed/org.eclipse.xtext.orbitreplacement.target/org.eclipse.xtext.orbitreplacement.target.target#L5
https://läubisoft.gmbh/en/articles/using-maven-artifacts-in-pde-rcp-and-tycho-builds/

Alternative check if the stuff you want to consume already exists as p2 repo and include these
In the target


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: Including Maven Dependencies on XText Eclipse Project [message #1851933 is a reply to message #1851926] Thu, 21 April 2022 20:16 Go to previous messageGo to next message
Ben Holland is currently offline Ben HollandFriend
Messages: 34
Registered: April 2019
Member
Yeah I believe its using the tycho plugin (I'm not very familiar with the plugin), but its just the default maven structure that is generated with the Xtext maven wizard for latest release. Sadly symja is not in the Orbit repos already, although I suppose I could always just make an Eclipse plugin that wraps up those dependencies. I tried the M2Eclipse plugin you linked and I felt like that was progress, but I'm still missing something.

I saw the Xtext maven wizard created a .target project with a .target file that was expected by M2Eclipse so I entered the artifact repo and maven dependencies there and the UI reports the jars I expect to see. In the main project do I need to add pom.xml entries or MANIFEST.MF entries to use the maven artifacts? They don't seem to be on the classpath still.
Re: Including Maven Dependencies on XText Eclipse Project [message #1851934 is a reply to message #1851933] Thu, 21 April 2022 20:43 Go to previous messageGo to next message
Ben Holland is currently offline Ben HollandFriend
Messages: 34
Registered: April 2019
Member
Oh here's probably an issue. For each of my entries I am getting a

[WARNING] Target location type 'Maven' is not supported

[Updated on: Thu, 21 April 2022 21:29]

Report message to a moderator

Re: Including Maven Dependencies on XText Eclipse Project [message #1851935 is a reply to message #1851934] Fri, 22 April 2022 05:41 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14726
Registered: July 2009
Senior Member
are you sure you use latest tycho version?
And no you need the target file only.
If you then install the m2e pde feature as in blog
You can load the target file in eclipse
And add a require bundle to the manifest


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com

[Updated on: Fri, 22 April 2022 07:54]

Report message to a moderator

Re: Including Maven Dependencies on XText Eclipse Project [message #1851958 is a reply to message #1851935] Fri, 22 April 2022 21:39 Go to previous message
Ben Holland is currently offline Ben HollandFriend
Messages: 34
Registered: April 2019
Member
Ah I think I was missing the required bundle. Thanks!
Previous Topic:[1...*] cardinality in xtext
Next Topic:Custom Syntax Colouring for ide
Goto Forum:
  


Current Time: Tue Oct 15 12:22:30 GMT 2024

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

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

Back to the top