gluonhq / ide-plugins

Gluon integration with Java IDEs
BSD 3-Clause "New" or "Revised" License
20 stars 8 forks source link

Gluon plugin fails to install on Eclipse 2022-12 #55

Closed abhinayagarwal closed 1 year ago

abhinayagarwal commented 1 year ago

Cannot complete the install because one or more required items could not be found.

Software being installed: Gluon Plug-in for Eclipse 2.8.0
(com.gluonhq.eclipse.feature.feature.group 2.8.0)
Missing requirement: Gluon Plug-in for Eclipse 2.8.0
(com.gluonhq.eclipse.plugin 2.8.0) requires 'osgi.bundle; com.google.guava
[21.0.0,27.1.0)' but it could not be found
Cannot satisfy dependency:
From: Gluon Plug-in for Eclipse 2.8.0
(com.gluonhq.eclipse.feature.feature.group 2.8.0)
To: org.eclipse.equinox.p2.iu; com.gluonhq.eclipse.plugin [2.8.0,2.8.0]
hallvard commented 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'

hallvard commented 1 year ago

I managed to build using 2022-12 and install into it afterwards. Most important changes were:

- 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.
johanvos commented 1 year ago

Great, thanks!

macgibbon commented 1 year ago

Nice job!

macgibbon commented 1 year ago

I would also add that it appears Java 17 must be used to run Maven

johanvos commented 1 year ago

@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?

hallvard commented 1 year ago

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.

abhinayagarwal commented 1 year ago

AFAIK, m2e is for EE support in Eclipse. If yes, then may be we get rid of the dependency.

macgibbon commented 1 year ago

@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