Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Cannot build old Xtext projects with maven since 2021-06-16
Cannot build old Xtext projects with maven since 2021-06-16 [message #1842377] Thu, 17 June 2021 06:53 Go to next message
Eclipse UserFriend
It seems that when doing a maven build, it is now using "202106171039" that is compiled with java 11 and when trying to inject OperationCanceledException into XtendCompile, it fails.
It also fails Mwe2

It can be reproduced with an empty maven Xtext project (at least on Xtext 2.13 Neon)
I've tried to specify the dependencies in a target file without success (same error):

<unit id="org.eclipse.platform.feature.group" version="4.6.0.v20160606-1342"/>
<unit id="org.eclipse.equinox.common" version="3.8.0.v20160509-1230"/>


We're in the process of upgrading to Eclipse 2021-03 and Xtext 2.25, but we have to support the older version as well

Does anyone know how to lock an older osgi version?

[INFO] --- tycho-packaging-plugin:1.0.0:build-qualifier (default-build-qualifier) @ org.xtext.example.mydsl ---
[INFO] The project's OSGi version is 1.0.0.202106171039
[INFO] 
[INFO] --- tycho-packaging-plugin:1.0.0:validate-id (default-validate-id) @ org.xtext.example.mydsl ---
[INFO] 
[INFO] --- tycho-packaging-plugin:1.0.0:validate-version (default-validate-version) @ org.xtext.example.mydsl ---
[INFO] 
[INFO] --- exec-maven-plugin:1.4.0:java (mwe2Launcher) @ org.xtext.example.mydsl ---
0    [org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main()] ERROR mf.mwe2.launch.runtime.Mwe2Launcher  - org/eclipse/core/runtime/OperationCanceledException has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
java.lang.UnsupportedClassVersionError: org/eclipse/core/runtime/OperationCanceledException has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:756)


[WARNING] Error injecting: org.eclipse.xtend.maven.XtendCompile
com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) Error injecting constructor, com.google.inject.internal.util.$ComputationException: com.google.inject.internal.util.$ComputationException: java.lang.UnsupportedClassVersionError: org/eclipse/core/runtime/OperationCanceledException has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
  at org.eclipse.xtend.maven.XtendCompile.<init>(Unknown Source)
  while locating org.eclipse.xtend.maven.XtendCompile

1 error

[Updated on: Thu, 17 June 2021 06:57] by Moderator

Re: Cannot build old Xtext projects with maven since 2021-06-16 [message #1842378 is a reply to message #1842377] Thu, 17 June 2021 07:43 Go to previous messageGo to next message
Eclipse UserFriend
https://github.com/eclipse/xtext/issues/1976
Re: Cannot build old Xtext projects with maven since 2021-06-16 [message #1842381 is a reply to message #1842378] Thu, 17 June 2021 08:11 Go to previous messageGo to next message
Eclipse UserFriend
Hi

See also https://bugs.eclipse.org/bugs/show_bug.cgi?id=574259

I suspect that Java 8 for Eclipse is now dead, since 2021-06 is out with broken Java 8 and the developers struggle to keep up with the demands of Java next.

Regards

Ed Willink
Re: Cannot build old Xtext projects with maven since 2021-06-16 [message #1842422 is a reply to message #1842381] Fri, 18 June 2021 04:51 Go to previous messageGo to next message
Eclipse UserFriend
Based on the info from the ticket, this works for me in XText 2.13

Parent pom.xml:

				<plugin>
					<groupId>org.eclipse.xtend</groupId>
					<artifactId>xtend-maven-plugin</artifactId>
					<version>${xtextVersion}</version>
					<executions>
						<execution>
							<goals>
								<goal>compile</goal>
								<goal>xtend-install-debug-info</goal>
								<goal>testCompile</goal>
								<goal>xtend-test-install-debug-info</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<outputDirectory>${basedir}/xtend-gen</outputDirectory>
						<testOutputDirectory>${basedir}/xtend-gen</testOutputDirectory>
					</configuration>
					<dependencies>
						<dependency>
							<groupId>org.eclipse.jdt</groupId>
							<artifactId>org.eclipse.jdt.core</artifactId>
							<version>3.12.2</version>
							<exclusions>
								<exclusion>
									<groupId>org.eclipse.platform</groupId>
									<artifactId>org.eclipse.equinox.common</artifactId>
								</exclusion>
								<exclusion>
									<groupId>org.eclipse.platform</groupId>
									<artifactId>org.eclipse.core.runtime</artifactId>
								</exclusion>
							</exclusions>
						</dependency>
						<dependency>
							<groupId>org.eclipse.jdt</groupId>
							<artifactId>org.eclipse.jdt.compiler.apt</artifactId>
							<version>1.2.100</version>
							<exclusions>
								<exclusion>
									<groupId>org.eclipse.platform</groupId>
									<artifactId>org.eclipse.equinox.common</artifactId>
								</exclusion>
								<exclusion>
									<groupId>org.eclipse.platform</groupId>
									<artifactId>org.eclipse.core.runtime</artifactId>
								</exclusion>
							</exclusions>
						</dependency>
						<dependency>
							<groupId>org.eclipse.jdt</groupId>
							<artifactId>org.eclipse.jdt.compiler.tool</artifactId>
							<version>1.2.51</version>
							<exclusions>
								<exclusion>
									<groupId>org.eclipse.platform</groupId>
									<artifactId>org.eclipse.equinox.common</artifactId>
								</exclusion>
								<exclusion>
									<groupId>org.eclipse.platform</groupId>
									<artifactId>org.eclipse.core.runtime</artifactId>
								</exclusion>
							</exclusions>
						</dependency>
						<dependency>
							<groupId>org.eclipse.emf</groupId>
							<artifactId>org.eclipse.emf.codegen</artifactId>
							<version>2.11.0</version>
						</dependency>
						
					</dependencies>
				</plugin>



Grammar pom.xml in Mwe2Launcher:

					<dependency>
						<groupId>org.eclipse.xtext</groupId>
						<artifactId>org.eclipse.xtext.xtext.generator</artifactId>
						<version>${xtextVersion}</version>
						<exclusions>
							<exclusion>
								<groupId>org.eclipse.platform</groupId>
								<artifactId>org.eclipse.equinox.common</artifactId>
							</exclusion>
							<exclusion>
								<groupId>org.eclipse.platform</groupId>
								<artifactId>org.eclipse.core.runtime</artifactId>
							</exclusion>
						</exclusions>
					</dependency>

Re: Cannot build old Xtext projects with maven since 2021-06-16 [message #1842454 is a reply to message #1842422] Sat, 19 June 2021 23:35 Go to previous messageGo to next message
Eclipse UserFriend
I ran into this issue as well, and was mainly able to work around it by upgrading the CI build configuration to Java 11.
Another issue, that I have been not able to work around is that I also lost my ability to build individual modules of my Maven project. When I run a module by itself, I now get:
compile failed: com.google.inject.internal.util.$ComputationException: com.google.inject.internal.util.$ComputationException: com.google.inject.internal.util.$ComputationException: com.google.inject.internal.util.$ComputationException: com.google.inject.internal.util.$ComputationException: java.lang.SecurityException: class "org.eclipse.core.runtime.OperationCanceledException"'s signer information does not match signer information of other classes in the same package
.
However if I build the entire project including the root POM, everything still builds fine.
Does anyone have any ideas how resolve this secondary issue?
Re: Cannot build old Xtext projects with maven since 2021-06-16 [message #1842455 is a reply to message #1842454] Sat, 19 June 2021 23:58 Go to previous message
Eclipse UserFriend
again: make sure you use consistent versions of core.runtime and equinox common. so in this case you should use -X to make see which one are picks.
if you use tycho it may help to use -Dtycho.localAritfacts=ignore to get consistent behaviours
Previous Topic:XExpressions and Statements
Next Topic:cannot build old xtend projects with gradle
Goto Forum:
  


Current Time: Sun Apr 20 07:02:30 EDT 2025

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

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

Back to the top