Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provided dependencies from imported BOM are not correctly calculated on hover #347

Closed
CarlosMOGoncalves opened this issue Jan 16, 2023 · 3 comments · Fixed by #355 or #357
Closed

Comments

@CarlosMOGoncalves
Copy link

CarlosMOGoncalves commented Jan 16, 2023

Description


Hello there,

In Eclipse IDE for Enterprise Java and Web Developers 2022-12 the provided dependencies that are managed by a BOM import declared in its POM or a parent POM are not correctly calculated.

The editor, on hover, will state that the managed on which is not the one declared on the import dependency, but some other (I haven't figured which one it is picking).

If, however, we Ctrl+click on it, to navigate to the POM, it will navigate to the correct version.

This seems to happen only on provided dependencies and not on compile, as the latter are correctly calculated when the imported BOM is present.

Steps to reproduce

I have prepared a sample application that has a very simple Payara Micro application
It can be found here

This app does nothing special. It has a Jakarta REST endpoint but that is just for show.

  1. Fresh install Eclipse for Eclipse IDE for Enterprise Java and Web Developers 2022-12
  2. Checkout the project from my repository
  3. Proceed to build the project using mvn clean install
  4. Navigate to the POM and hover over one of the provided dependencies, for example the Jakarta one:

image

  1. This is not the correctly managed one, as that is stated on the BOM imported above and its value is 8.0.0
  2. If we Ctrl+click the jakartaee-api dependency it will navigate to the correct 8.0.0 pom
  3. This happens in all those 3 provided dependencies: jakartaee, microprofile and eclipselink
  4. However, it does not happen when we check the compile dependency, in this case AWS SDK, which is the correct one, as imported above:

image

  1. Also, I think that the poms where these dependencies are managed might not be correct. I think all those dependencies are managed in the respective BOMs above, but when Ctrl-clicking them, it should navigate to the artifact POM, as it is doing right now.

Environment

  • Distribution: Eclipse IDE for Enterprise Java and Web Developers 2022-12 2022-12 for Windows x64
  • M2E version: 2.1.2.20221130-2239 (eclipse 2022-12 default)
@mickaelistria
Copy link
Contributor

Do you think you could create a minimal reproducer for this issue (with 1 parent BOM and 1 consumer and just 1 dependency) in order to facilitate debug and even to include it as a test case directly.

JDK Version: Corretto JDK 11

In practice, your IDE is using the embedded OpenJDK 17 packaged for Eclipse RCP applications by Eclipse JustJ project.

@CarlosMOGoncalves
Copy link
Author

Sure, let's give it a try.

I have created this project in my repo, eclipse-bom-tester

It has a child pom that has a parent pom which resides inside the parent folder.

Although you asked me for just one dependency I have included 2 because I found another issue that is likely related to this one.

In short:

  • dependencies whose origin reside in an import pom will have their version incorrect. Below, the correct version as imported should be 8.0.0, not 9.0.0-RC2

image

  • dependencies whose origin reside in the parent pom AND their version is defined in a property will rather show the property name and not the actual number

image

  • In both cases, Ctrl-click will navigate to the correct version

In practice, your IDE is using the embedded OpenJDK 17 packaged for Eclipse RCP applications by Eclipse JustJ project.

You are correct. This is unneeded info I just copied from another issue of mine, where the version is relevant and I am using an external JDK for runtime. I will remove it from he original issue.

vrubezhny added a commit to vrubezhny/lemminx-maven that referenced this issue Feb 1, 2023
vrubezhny added a commit to vrubezhny/lemminx-maven that referenced this issue Feb 1, 2023
vrubezhny added a commit to vrubezhny/lemminx-maven that referenced this issue Feb 1, 2023
vrubezhny added a commit to vrubezhny/lemminx-maven that referenced this issue Feb 1, 2023
@vrubezhny vrubezhny linked a pull request Feb 1, 2023 that will close this issue
vrubezhny added a commit to vrubezhny/lemminx-maven that referenced this issue Feb 1, 2023
@mickaelistria
Copy link
Contributor

The merged PR improves some cases but doesn't fix the whole issue of showing managed version. Let's reopen.

@mickaelistria mickaelistria reopened this Feb 1, 2023
vrubezhny added a commit to vrubezhny/lemminx-maven that referenced this issue Feb 1, 2023
…ulated on hover eclipse-lemminx#347

JUnit for the version defined with property variable in parent pom.xml
vrubezhny added a commit to vrubezhny/lemminx-maven that referenced this issue Feb 1, 2023
…on hover eclipse-lemminx#347

A fix for the case with the version defined with property variable in parent pom.xml and JUnit test case
vrubezhny added a commit to vrubezhny/lemminx-maven that referenced this issue Feb 1, 2023
…on hover eclipse-lemminx#347

A fix for the case with the version defined with property variable in parent pom.xml and JUnit test case
vrubezhny added a commit that referenced this issue Feb 2, 2023
…on hover #347

A fix for the case with the version defined with property variable in parent pom.xml and JUnit test case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants