Closed abhinayagarwal closed 1 year ago
The above message says the Gluon plugin requires guava with version between 21 and 27, but 2022-12. Using the Plugin registry panel (part of the Eclipse PDE tools), it seemed 2022-12 only provides guava 30.1.0. However, I couldn't get the plugin to build at all using 2022-12, since the Tycho version in use 1.6.0 doesn't recognise Osgi execution environment JavaSE-17 which org.eclipse.m2e.core 2.0.5 seems to declare as a dependency. Hence, the build fails:
Internal error: org.eclipse.tycho.core.ee.UnknownEnvironmentException: Unknown OSGi execution environment: 'JavaSE-17'
I managed to build using 2022-12 and install into it afterwards. Most important changes were:
<tycho.plugin.version>2.7.5</tycho.plugin.version>
<url>https://nexus.gluonhq.com/nexus/content/repositories/releases/</url>
<url>https://nexus.gluonhq.com/nexus/content/repositories/snapshots/</url>
- change the version range for guava to include 31.1.0
` com.google.guava;bundle-version="[21.0.0,30.1.0]",`
- remove errors about access restrictions (for guava) be using -err flag
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compile-plugin</artifactId>
<version>${tycho.plugin.version}</version>
<configuration>
<compilerArgument>-err:+discouraged,forbidden</compilerArgument>
</configuration>
</plugin>
I'll need to fork the original repo to create a PR later today.
Great, thanks!
Nice job!
I would also add that it appears Java 17 must be used to run Maven
@macgibbon What is causing the restriction on Java 17? In the PR I see a dependency added to Java 11 -- which seems very ok to me. I personally have no objections against Java 17, but maybe some developers are stuck on something between 11 and 17?
The previous version of Tycho didn't know about JavaSE-17 at all, so it choked on some dependency (I think it was org.eclipse.m2e.core) that used that tag in the Osgi metadata. This doesn't necessarily mean that Java 17 is required, just that some jar is for Java 17 (perhaps there are different ones for different Java versions). Usually, you need the same language level, so Java 17 should be used to build, yes. Note that I only checked I could install into 2022-12, I didn't try to install into older Eclipse versions.
AFAIK, m2e is for EE support in Eclipse. If yes, then may be we get rid of the dependency.
@macgibbon What is causing the restriction on Java 17? In the PR I see a dependency added to Java 11 -- which seems very ok to me. I personally have no objections against Java 17, but maybe some developers are stuck on something between 11 and 17?
I am getting the following error when running maven with the Java 11.
[ERROR] Cannot resolve project dependencies: [ERROR] Software being installed: com.gluonhq.eclipse.plugin 2.8.4.qualifier [ERROR] Missing requirement: org.eclipse.m2e.core 2.0.5.20221128-1757 requires 'osgi.ee; (&(osgi.ee=JavaSE)(version=17))' but it could not be found [ERROR] Cannot satisfy dependency: com.gluonhq.eclipse.plugin 2.8.4.qualifier depends on: osgi.bundle; org.eclipse.m2e.core 0.0.0
Cannot complete the install because one or more required items could not be found.