Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Xtext 2.26 based Maven build failing since 2022-06-15
Xtext 2.26 based Maven build failing since 2022-06-15 [message #1853050] Wed, 15 June 2022 16:53 Go to next message
Eclipse UserFriend
As of 2022-06-15 my Xtext-based builds are failing even though there have been no recent changes in the build configuration. This might be similar to some of the issues described in https://www.eclipse.org/forums/index.php/t/1110866/ but I haven't upgraded to 2.27 yet, so I figured I open a new topic. The problem also feels somewhat reminiscent of https://github.com/eclipse/xtext/issues/1976 but I hope I'm incorrect in that assessment.

Without any releveant changes, as of 2022-06-15 my CI build is failing with this error message:
Error:  Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:java (mwe2Launcher) on project fxxx: 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:jar:2.19.0 -> org.eclipse.platform:org.eclipse.core.runtime:jar:3.12.0 -> org.eclipse.platform:org.eclipse.equinox.preferences:jar:3.10.0 -> org.osgi.service:org.osgi.service.prefs:jar:[1.1.0,1.2.0): No versions available for org.osgi.service:org.osgi.service.prefs:jar:[1.1.0,1.2.0) within specified range -> [Help 1]

Interestingly, my local build fails with a different problem, but I think this might be due to a different state of my local m2 repository (the CI build always starts with an empty repository):
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:java (mwe2Launcher) on project fxxx: 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:jar:2.19.0 -> org.eclipse.platform:org.eclipse.core.resources:jar:3.17.0 -> org.eclipse.platform:org.eclipse.core.runtime:jar:[3.25.0,4.0.0): No versions available for org.eclipse.platform:org.eclipse.core.runtime:jar:[3.25.0,4.0.0) within specified range -> [Help 1]

My repository configuration has been unchanged since March and worked fine both locally and on CI as of yesterday:
 <repositories>
  <repository>
   <id>eclipse</id>
   <url>https://download.eclipse.org/releases/2021-09/</url>
   <layout>p2</layout>
  </repository>
  <repository>
   <id>xtext</id>
   <url>https://download.eclipse.org/modeling/tmf/xtext/updates/releases/2.26.0/</url>
   <layout>p2</layout>
  </repository>
  <repository>
   <id>mwe</id>
   <url>https://download.eclipse.org/modeling/emft/mwe/updates/releases/2.12.2/</url>
   <layout>p2</layout>
  </repository>
 </repositories>

My MWE launcher configuration is (also unchanged since March or so):
   <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>3.0.0</version> <!-- see: https://stackoverflow.com/questions/32448768 -->
    <executions>
     <execution>
      <id>mwe2Launcher</id>
      <phase>generate-sources</phase>
      <goals>
       <goal>java</goal>
      </goals>
     </execution>
    </executions>
    <configuration>
     <mainClass>org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher</mainClass>
     <arguments>
      <argument>/${project.basedir}/src/fxxx/Fxxx.mwe2</argument>
      <argument>-p</argument>
      <argument>rootPath=/${project.basedir}/..</argument>
     </arguments>
     <classpathScope>compile</classpathScope>
     <includePluginDependencies>true</includePluginDependencies>
     <cleanupDaemonThreads>false</cleanupDaemonThreads><!-- see https://bugs.eclipse.org/bugs/show_bug.cgi?id=475098#c3 -->
    </configuration>
    <dependencies>
     <dependency>
      <groupId>org.eclipse.emf</groupId>
      <artifactId>org.eclipse.emf.mwe2.launch</artifactId>
      <version>${mwe2.version}</version>
     </dependency>
     <dependency>
      <groupId>org.eclipse.emf</groupId>
      <artifactId>org.eclipse.emf.mwe2.runtime</artifactId>
      <version>${mwe2.version}</version>
     </dependency>
     <!-- Without explicitly adding this Language Core build will fail: -->
     <dependency>
      <groupId>org.eclipse.emf</groupId>
      <artifactId>org.eclipse.emf.mwe2.language</artifactId>
      <version>${mwe2.version}</version>
     </dependency>
     <dependency>
      <groupId>org.eclipse.xtext</groupId>
      <artifactId>org.eclipse.xtext.common.types</artifactId>
      <version>${xtext.version}</version>
     </dependency>
     <dependency>
      <groupId>org.eclipse.xtext</groupId>
      <artifactId>org.eclipse.xtext.xtext.generator</artifactId>
      <version>${xtext.version}</version>
     </dependency>
     <dependency>
      <groupId>org.eclipse.xtext</groupId>
      <artifactId>org.eclipse.xtext.xbase</artifactId>
      <version>${xtext.version}</version>
     </dependency>
     <dependency>
      <groupId>org.eclipse.xtext</groupId>
      <artifactId>xtext-antlr-generator</artifactId>
      <version>[2.1.1, 3)</version>
     </dependency>
    </dependencies>
   </plugin>

Can anyone shed some light as to what's going on here? As far as I understand it, I have all my dependencies hard-coded, so I'm not sure how any sort of change in the remote repositories could cause this issue.
Re: Xtext 2.26 based Maven build failing since 2022-06-15 [message #1853053 is a reply to message #1853050] Wed, 15 June 2022 18:06 Go to previous messageGo to next message
Eclipse UserFriend
I think I've tracked this down to org.eclipse.emf:org.eclipse.emf.codegen referring to core.resources and core.runtime dependencies by version ranges instead of specific versions, which usually is not great when it comes to ensuring reproducible builds. So, it looks like the problem was due to incompatible artifacts being used when new versions became available in the specified range.

I was able to fix the problem by making the following additions to my POM:
--- a/pom.xml
+++ b/pom.xml
@@ -92,6 +92,16 @@
       <groupId>org.eclipse.xtext</groupId>
       <artifactId>org.eclipse.xtext.xtext.generator</artifactId>
       <version>${xtext.version}</version>
+      <exclusions>
+       <exclusion>
+        <groupId>org.eclipse.platform</groupId>
+        <artifactId>org.eclipse.core.resources</artifactId>
+       </exclusion>
+       <exclusion>
+        <groupId>org.eclipse.platform</groupId>
+        <artifactId>org.eclipse.core.runtime</artifactId>
+       </exclusion>
+      </exclusions>
      </dependency>
      <dependency>
       <groupId>org.eclipse.xtext</groupId>
@@ -103,6 +113,31 @@
       <artifactId>xtext-antlr-generator</artifactId>
       <version>[2.1.1, 3)</version>
      </dependency>
+     <dependency>
+      <groupId>org.eclipse.emf</groupId>
+      <artifactId>org.eclipse.emf.codegen</artifactId>
+      <version>2.19.0</version>
+      <exclusions>
+       <exclusion>
+        <groupId>org.eclipse.platform</groupId>
+        <artifactId>org.eclipse.core.resources</artifactId>
+       </exclusion>
+       <exclusion>
+        <groupId>org.eclipse.platform</groupId>
+        <artifactId>org.eclipse.core.runtime</artifactId>
+       </exclusion>
+      </exclusions>
+     </dependency>
+     <dependency>
+      <groupId>org.eclipse.platform</groupId>
+      <artifactId>org.eclipse.core.resources</artifactId>
+      <version>3.16.0</version>
+     </dependency>
+     <dependency>
+      <groupId>org.eclipse.platform</groupId>
+      <artifactId>org.eclipse.core.runtime</artifactId>
+      <version>3.23.0</version>
+     </dependency>
     </dependencies>
    </plugin>
    <plugin>
Re: Xtext 2.26 based Maven build failing since 2022-06-15 [message #1853060 is a reply to message #1853053] Wed, 15 June 2022 23:50 Go to previous messageGo to next message
Eclipse UserFriend
See https://github.com/eclipse/xtext/issues/2077 and linked issues
Re: Xtext 2.26 based Maven build failing since 2022-06-15 [message #1853090 is a reply to message #1853060] Fri, 17 June 2022 03:14 Go to previous message
Eclipse UserFriend
eclipse platform has pulled the bad artifact(s) from maven central. so (at least after the clearing of local maven repos or mirrors) the problem should be solved
Previous Topic:Vscode extension formatting has different behavior than Eclipse
Next Topic:Move Eobject from one container to another container in EMF
Goto Forum:
  


Current Time: Sat Jul 12 11:28:41 EDT 2025

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

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

Back to the top