Skip to main content



      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 14:05 Go to next message
Eclipse UserFriend
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 14:25 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Including Maven Dependencies on XText Eclipse Project [message #1851933 is a reply to message #1851926] Thu, 21 April 2022 16:16 Go to previous messageGo to next message
Eclipse UserFriend
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 16:43 Go to previous messageGo to next message
Eclipse UserFriend
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 17:29] by Moderator

Re: Including Maven Dependencies on XText Eclipse Project [message #1851935 is a reply to message #1851934] Fri, 22 April 2022 01:41 Go to previous messageGo to next message
Eclipse UserFriend
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

[Updated on: Fri, 22 April 2022 03:54] by Moderator

Re: Including Maven Dependencies on XText Eclipse Project [message #1851958 is a reply to message #1851935] Fri, 22 April 2022 17:39 Go to previous message
Eclipse UserFriend
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: Mon Apr 28 15:45:04 EDT 2025

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

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

Back to the top