OpenLiberty / open-liberty-tools

Open Liberty Tools are lightweight tools for developing, assembling, and deploying apps to Open Liberty.
http://openliberty.io
Eclipse Public License 1.0
51 stars 40 forks source link

OL tools v22.[1-2] do not install on Eclipse JEE 2022-[06,09,12] (v4.[24,25,26]) because of org.eclipse.m2e.maven.runtime version requirement #460

Closed titou10titou10 closed 7 months ago

titou10titou10 commented 2 years ago

As the title says, open liberty tools v22.1 and v22.2 do not install on eclipse 2022-06 (v4.24), 2022-09 (v4.25) and 2022-12 (v4.26)

OL tools requires pluginorg.eclipse.m2e.maven.runtime [1.1.0,2.0.0)that is not included with Eclipse JEE v2022-[06,09,12] Eclipse JEE v2022-09 includesorg.eclipse.m2e.maven.runtime v3.8

Cannot complete the install because one or more required items could not be found.
  Software being installed: WebSphere® Application Server Liberty Tools 21.0.12.v2022-05-24_1817 (com.ibm.ws.st.liberty.tools.feature.group 21.0.12.v2022-05-24_1817)
  Missing requirement: Maven Tools for Liberty 1.2.2.v2022-05-24_1817 (com.ibm.etools.maven.liberty.integration 1.2.2.v2022-05-24_1817) requires 'osgi.bundle; org.eclipse.m2e.maven.runtime [1.1.0,2.0.0)' but it could not be found
  Cannot satisfy dependency:
    From: WebSphere® Application Server Liberty Tools 1.0.9.v2022-05-24_1817 (com.ibm.ws.st.liberty.tools.base.feature.group 1.0.9.v2022-05-24_1817)
    To: org.eclipse.equinox.p2.iu; com.ibm.etools.maven.liberty.integration [1.2.2.v2022-05-24_1817,1.2.2.v2022-05-24_1817]
  Cannot satisfy dependency:
    From: WebSphere® Application Server Liberty Tools 21.0.12.v2022-05-24_1817 (com.ibm.ws.st.liberty.tools.feature.group 21.0.12.v2022-05-24_1817)
    To: org.eclipse.equinox.p2.iu; com.ibm.ws.st.liberty.tools.base.feature.group [1.0.9.v2022-05-24_1817,1.0.9.v2022-05-24_1817]

OL tools v22.1/v22.2 have been downloaded from https://openliberty.io/start/#eclipse_developer_tools Same error when trying to install OL tools via Eclipse Marketplace: "IBM Liberty Developer Tools 22.1" (p2 location=https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/updates/wdt/2022-03_comp/)

mattcolegate commented 2 years ago

Hi @titou10titou10 , thanks for opening this. Initial investigation shows that 2022-09 and 2022-06 both have missing dependencies when trying to install WDT (of which OLT is a subset). Can I ask if it is possible for you to use 2022-03 until our next release at the end of November? Or is there needed function for you in the latest release of Eclipse?

titou10titou10 commented 2 years ago

@mattcolegate yw I have to check for eclipse version but Eclipse 2022-03 is "quite old". We probably can stay with Eclipse 2022-03, this is the version we are currently using Is the problem just a matter of relaxing the version requirement or is it deeper than that?

https://github.com/OpenLiberty/open-liberty-tools/blob/658b424fb17626b98b587c28e6255a588540d0d9/dev/com.ibm.etools.maven.liberty.integration/META-INF/MANIFEST.MF#L88

I can try to change this dependency version requirement, compile the plugin on my side and see how it goes

mattcolegate commented 2 years ago

It's probably as you say, just relaxing the version requirement. As we're now committing to two releases a year it's inevitable that we will get these kind of errors as Eclipse moves beneath us.

titou10titou10 commented 2 years ago

Can I ask if it is possible for you to use 2022-03 until our next release at the end of November? Or is there needed function for you in the latest release of Eclipse? As we're now committing to two releases a year it's inevitable that we will get these kind of errors as Eclipse moves beneath us.

Hummm.... Today, this means that users of OLP will be stuck with a version of Eclipse that will be 9 months old (March -> November/December) I can understand the strategy for publishing a new version twice a year. IMHO for most "minor" bugs this is okay, but for bugs like this one where you can not even install the plugin, IMHO "intermediate/emergency" releases should be published. 9 months can be looong

titou10titou10 commented 2 years ago

When I change this

https://github.com/OpenLiberty/open-liberty-tools/blob/658b424fb17626b98b587c28e6255a588540d0d9/dev/com.ibm.etools.maven.liberty.integration/META-INF/MANIFEST.MF#L88

into

    Require-Bundle: org.eclipse.m2e.maven.runtime,

and build the plugin, it installs in Eclipse v2022-09 / 4.25 without problem and it seem to work as expected

JanSerneels commented 1 year ago

gradle build didn't work for me after clone, so i edited the jar file inside the zip file instead.

openlibertytools-22.1.zip com.ibm.etools.maven.liberty.integration_1.2.2.v2022-05-24_1817.jar

After editing MANIFEST.MF as you suggest i tried to install openliberty-tools in eclipse 2022-09-EE.

Seems the version contraint is still active somehow. What did i miss?

This is the error message i get :

Cannot complete the install because one or more required items could not be found. Software being installed: WebSphere® Application Server Liberty Tools 21.0.12.v2022-05-24_1817 (com.ibm.ws.st.liberty.tools.feature.group 21.0.12.v2022-05-24_1817) Missing requirement: Maven Tools for Liberty 1.2.2.v2022-05-24_1817 (com.ibm.etools.maven.liberty.integration 1.2.2.v2022-05-24_1817) requires 'osgi.bundle; org.eclipse.m2e.maven.runtime [1.1.0,2.0.0)' but it could not be found Cannot satisfy dependency: From: WebSphere® Application Server Liberty Tools 1.0.9.v2022-05-24_1817 (com.ibm.ws.st.liberty.tools.base.feature.group 1.0.9.v2022-05-24_1817) To: org.eclipse.equinox.p2.iu; com.ibm.etools.maven.liberty.integration [1.2.2.v2022-05-24_1817,1.2.2.v2022-05-24_1817] Cannot satisfy dependency: From: WebSphere® Application Server Liberty Tools 21.0.12.v2022-05-24_1817 (com.ibm.ws.st.liberty.tools.feature.group 21.0.12.v2022-05-24_1817) To: org.eclipse.equinox.p2.iu; com.ibm.ws.st.liberty.tools.base.feature.group [1.0.9.v2022-05-24_1817,1.0.9.v2022-05-24_1817]

openlibertytools-22.1-janSerneels.zip

titou10titou10 commented 1 year ago

gradle build didn't work for me after clone, so i edited the jar file inside the zip file instead.

What went wrong with the gradle build? To build, I just change the location of the eclipse SDK . From

https://github.com/OpenLiberty/open-liberty-tools/blob/658b424fb17626b98b587c28e6255a588540d0d9/dev/gradle.properties#L12-L14

to

# Target platform : Oxygen
eclipse.sdk.url=https://archive.eclipse.org/eclipse/downloads/drops4/R-4.7.3a-201803300640/eclipse-SDK-4.7.3a-linux-gtk-x86_64.tar.gz
eclipse.target.platform.url=https://archive.eclipse.org/technology/epp/downloads/release/oxygen/3a/eclipse-jee-oxygen-3a-linux-gtk-x86_64.tar.gz

My build of the plugin: openlibertytools-22.2.v2022-09-16_1548.zip

Remember that this is not an "official" build. The only change I made is removing the restriction on the version dependency. It may not be what the official fix will be. At least it installs on Eclipse v4.25 and it didn't show any problems in our setup/projects

JanSerneels commented 1 year ago
JanSerneels commented 1 year ago

Apparently WDT does not support JakartaEE 9 and Dynamic Web Project facet 5.0 in eclipse.

https://github.com/OpenLiberty/open-liberty-tools/wiki/22.1-Known-Issues

titou10titou10 commented 1 year ago

@JanSerneels please do not hijack this ticket. Please open another one as this is a totally different problem as the original one Thanks

titou10titou10 commented 1 year ago

OL tool 22.2 is out but it seems this bug is still present..

mattcolegate commented 1 year ago

@titou10titou10 Unfortunately we were unable to contain this work for the 22.2 release. We will look to update this soon, and I will be pushing for a fix process to be identified so that we do not have this dragging on for another six months. 22.2 is targeted at 2022-03 Eclipse. I'm sorry I forgot to update you on this earlier.

titou10titou10 commented 1 year ago

wow!!! OLP tools v22.2 targets Eclipse 2022-03 AT MOST ??? This means that if you want to use OLP tools with Eclipse, you are stuck with Eclipse v2022-03 or earlier, a version that will be 15 months old when v23.1 will be out, ie in 6 months?
What you are saying is that wee need to wait fo Eclipse 2023-06 to be able to use the OLP tools plugin again? wow

Sorry but IMHO this is clearly not acceptable

As said before, this is not a minor bug. this "simple" bug blocks you to install the whole plugin

Hopefully, as a workaround, I can build the plugin myself after having removed the plugin requirement as done before

I can create a PR that just remove the maven plugin version restriction (see comments above as I was able to install the plugin) as it is a one line change and it makes the plugin install and "work", but I'm not confident enough to says that this is the way to fix the bug

mattcolegate commented 1 year ago

Hi @titou10titou10,

One of our test team members has come up with a potential workaround - Download Eclipse 2022-03, install OLT 22.2 on that, then upgrade to Eclipse 2022-09. Can you give that a whirl and see if that might be a solution for you? Bear in mind that this will be an 'as-is' configuration and therefore not subject to official support, problems would still have to be opened from Eclipse 2022-03.

rosczja commented 1 year ago

Hi @mattcolegate , I did try this in the past. The problem is that m2e plugins are then not upgraded to version 2. If you need functionality in the newer version you are again stuck.

So I think the only viable option is to make OLT compatible with m2e >= 2.0.

titou10titou10 commented 1 year ago

As for v22.1 before, I build my own version of v22.2 after removing the "problematic" equinox dependency to "org.eclipse.m2e.maven.runtime v[1.1.0,2.0.0)" as described here:

https://github.com/OpenLiberty/open-liberty-tools/issues/460#issuecomment-1249828500

It installs on my freshly installed Eclipse v2022-12 JEE (v4.26). It seems to work so far, at least for my needs of the plugin Of course there is no guarantee it works in all use cases as I have no idea of the implications of the removal of the dependencies and if what I did is the right thing to do to fix the problem

openlibertytools-22.2.v2022-12-07_1446.zip

mattcolegate commented 1 year ago

Thanks @rosczja and @titou10titou10. @titou10titou10, are you able to put your change up as a pull request?

titou10titou10 commented 1 year ago

@mattcolegate , as explained before,I have no problem creating a PR with this one line change but I'm not confident at all that this the only change that has to be done, maybe some deeper changes have to be made for the plugin to interact with the latest version of the maven plugin

At least the change allows the plugin to install on the 3 latest version of Eclipse but if the version restriction is present in the code, I guess this is for a reason.

Removing the deployment restriction does not guarantee that the rest of the code (that was OK with org.eclipse.m2e.maven.runtime;bundle-version="[1.1.0,2.0.0)") is still adapted to work with"org.eclipse.m2e.maven.runtime" v3.8+, version included with Eclipse JEE v2022-06+

titou10titou10 commented 1 year ago

PR #466 created

pnickoll commented 1 year ago

FYI: We have found there are more changes required in order to get this to work but we are working on them and expect to have them in the next release. Many thanks for the PR - I will get that part merged in.

titou10titou10 commented 1 year ago

Until the official build is done, here are the OpenLiberty tools compiled from the integration branch that install on eclipse 2023-03

Note that I did not change any file from the integration branch and it installs flawlessly on eclipse v2023-03

openlibertytools-23.1.v2023-03-06_1555.zip

pnickoll commented 7 months ago

This should be fixed now in WDT 23.1. Please reopen if you still have issues.