Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How can I prevent my Xtext Maven build from breaking every 3 months?
How can I prevent my Xtext Maven build from breaking every 3 months? [message #1857899] Sun, 05 March 2023 01:17 Go to next message
Mirko Raner is currently offline Mirko RanerFriend
Messages: 125
Registered: July 2009
Location: New York City, NY
Senior Member
So... it happened again. Eclipse 2023-03 is about to be released, and, as usual, a couple days before the release, a bunch of new artifacts are uploaded to Maven Central. More often than not, the exec-maven-plugin execution that launches org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher in my build will break due to some new missing dependency that I don't even depend on . This has happened several times before and has been discussed extensively (https://www.eclipse.org/forums/index.php/m/1853050/#msg_1853050, https://www.eclipse.org/forums/index.php/m/1842377/#msg_1842377, https://github.com/eclipse/xtext/issues/1976, https://github.com/eclipse/xtext/issues/2077, etc.)

For my particular build, this time the error message is:
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:java (mwe2Launcher) on project fxx:
Execution mwe2Launcher of goal org.codehaus.mojo:exec-maven-plugin:3.0.0:java failed:
Plugin org.codehaus.mojo:exec-maven-plugin:3.0.0 or one of its dependencies could not be resolved:
Failed to collect dependencies at org.codehaus.mojo:exec-maven-plugin:jar:3.0.0
-> org.eclipse.xtext:org.eclipse.xtext.xtext.generator:jar:2.26.0
-> org.eclipse.emf:org.eclipse.emf.codegen.ecore:jar:2.20.0
-> org.eclipse.emf:org.eclipse.emf.codegen:jar:2.23.0
-> org.eclipse.emf:org.eclipse.emf.common:jar:[2.28.0,3.0.0):
No versions available for org.eclipse.emf:org.eclipse.emf.common:jar:[2.28.0,3.0.0) within specified range

The work-around, typically, is to manually exclude certain transitive dependencies, and provide specific compatible versions of certain libraries. A possible root cause, in my mind at least, is that some Eclipse libraries (e.g, org.eclipse.emf.codegen.ecore) are using version ranges for some dependencies, instead of specific versions.

In the past there was always talk of "bad" Maven artifacts that had been deployed to Central, and usually some work-around was found (in the form of exclusions and explicitly managed versions). How can I solve this issue in a way that won't break again a few days before the next release? Is there a better way to run the Mwe2Launcher that will not break before the next release?
Re: How can I prevent my Xtext Maven build from breaking every 3 months? [message #1857900 is a reply to message #1857899] Sun, 05 March 2023 06:55 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14738
Registered: July 2009
Senior Member
I propose to check what the new project wizard creates and also have a look at the xtext dev bom

=> question would be how your setup differs


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: How can I prevent my Xtext Maven build from breaking every 3 months? [message #1857901 is a reply to message #1857900] Sun, 05 March 2023 08:27 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33264
Registered: July 2009
Senior Member
This version exists and is very recently published:

https://repo1.maven.org/maven2/org/eclipse/emf/org.eclipse.emf.common/2.28.0/

That seems to contradict the error message "No versions available for org.eclipse.emf:org.eclipse.emf.common:jar:[2.28.0,3.0.0) within specified range". What might cause that?


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: How can I prevent my Xtext Maven build from breaking every 3 months? [message #1857903 is a reply to message #1857901] Sun, 05 March 2023 11:39 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14738
Registered: July 2009
Senior Member
i assume without building without -U maven only partially pulls new stuff.

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: How can I prevent my Xtext Maven build from breaking every 3 months? [message #1857906 is a reply to message #1857903] Sun, 05 March 2023 18:44 Go to previous messageGo to next message
Mirko Raner is currently offline Mirko RanerFriend
Messages: 125
Registered: July 2009
Location: New York City, NY
Senior Member
Thanks for your comments, Christian and Ed. I haven't run the Xtext project wizard in ages, so it's a good idea to check what it generates nowadays. In regard to org.eclipse.emf.common not being available: when the build started failing, that library was indeed available on Maven Central, however it was not in my local m2 repository, and for some reason it wasn't being downloaded either. When this failed previously, I recall that the situation was similar (i.e., artifact available on Central but didn't appear in local repo).
The larger problem, in my mind, is how my project suddenly depends on these new artifacts at all. My project is currently based on Xtext 2.26 and the Eclipse/Equinox/Ecore/EMF library versions that were current at that time. I don't use any "LATEST" versions, so the bigger question is really about reproducible builds, and how these newer artifacts make it into my build.
Anyway, I'll be updating to Xtext 2.30 (thanks, Christian!) shortly anyway, and I'll regenerate some of the POMs with the New Project Wizard, so hopefully that fixes things.
Re: How can I prevent my Xtext Maven build from breaking every 3 months? [message #1857910 is a reply to message #1857906] Mon, 06 March 2023 11:50 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7681
Registered: July 2009
Senior Member
It is possible that you chose a particularly inauspicious time between the Xtext maven updates, EMF maven updates and Platform updates.

(One of my regular release-based Tycho builds failed because it picked up the EMF Examples Library, which isn't in SimRel, from the latest EMF release but EMF itself from the not-so-latest SimRel.)
Re: How can I prevent my Xtext Maven build from breaking every 3 months? [message #1860989 is a reply to message #1857910] Wed, 13 September 2023 10:44 Go to previous messageGo to next message
Brandon Lewis is currently offline Brandon LewisFriend
Messages: 268
Registered: May 2012
Senior Member
I just updated my 2022-06 install from xtext 2.27 to xtext 2.28 and the basic mydsl example won't maven install right out of the box.

Cleared my m2 repository and retried and I'm getting a totally broken maven install with this error:

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/util/concurrent/internal/InternalFutureFailureAccess

Sort of related to the topic of "breaks every 3 months". Every version of xtext seems to have completely different maven behavior and, unfortunately, relying on the Project wizard examples doesn't always work because, in this example, they can't even build themselves.
Re: How can I prevent my Xtext Maven build from breaking every 3 months? [message #1860990 is a reply to message #1860989] Wed, 13 September 2023 10:56 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14738
Registered: July 2009
Senior Member
it would really help to have a reproducer. and also how you run maven
(always with -U)
and of course the question would be with which version of the wizard the project is created.
we cannot fix old wizards

=> i propose to diff with what the latest wizard creates


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

[Updated on: Wed, 13 September 2023 10:57]

Report message to a moderator

Previous Topic:Trouble Launching Language Server Jar in VSCode Extension
Next Topic:VSCode extension retrieve workspace configuration
Goto Forum:
  


Current Time: Mon Dec 30 17:30:42 GMT 2024

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

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

Back to the top