How can I prevent my Xtext Maven build from breaking every 3 months? [message #1857899] |
Sun, 05 March 2023 01:17 |
Mirko Raner 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 #1857906 is a reply to message #1857903] |
Sun, 05 March 2023 18:44 |
Mirko Raner 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.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07481 seconds