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

Non-resolvable parent POM for custom artifact #287

Closed
c-koell opened this issue Jul 21, 2021 · 28 comments
Closed

Non-resolvable parent POM for custom artifact #287

c-koell opened this issue Jul 21, 2021 · 28 comments
Milestone

Comments

@c-koell
Copy link

c-koell commented Jul 21, 2021

Hi!

With the new Eclipse Release 2021.06 we get the following error after opening the pom.xml

Non-resolvable parent POM for AEICP:dvtdependenciespom:2021.10: AEICP:dvtparent:pom:60 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced

The missing POM is of course in our own maven repository (artifactory). Before the upgrade we havn't seen this error.
We have configured our maven repository (Artifactory) in the local settings.xml

Is this a bug or must we define our own repository in a other way with the new Plugin Version ?

@mickaelistria
Copy link
Contributor

Which version of m2e are you using? Can you please make sure latest one (1.18.1) is used?

@c-koell
Copy link
Author

c-koell commented Jul 21, 2021

I have checked (updated) the version and we use the latest one (1.18.1) now but we see the same error..

@mmalmeida
Copy link

Same thing happening to me

@c-koell
Copy link
Author

c-koell commented Jul 29, 2021

Is the URL https://repo.maven.apache.org/maven2 anywhere hardcoded ?

@bolbat
Copy link

bolbat commented Jul 30, 2021

The same problem on our projects
Error message: Non-resolvable parent POM for ......: Could not find artifact ......

Reproducible with m2e 1.18.0 and 1.18.1 on Eclipse (Version: 2021-06 (4.20.0) Build id: 20210612-2011)

@TomBenjamins
Copy link

Same for my projects, running eclipse 21-06 with
m2e - Maven Integration for Eclipse (includes Incubating components) 1.18.0.20210603-1206,
it started occurring after being forced to update the POM Editor using LemMinX language server (includes Incubating components) 1.17.2.20210411-0929

If i manually add the custom repo url in the poms, it works again, but this should not be necessary, as the repo is already defined in my settings.xml.

If i revert to the previous installation without POM Editor using LemMinX language server (includes Incubating components) 1.17.2.20210411-0929 it works again.

@mickaelistria
Copy link
Contributor

I've retitled the issue to better capture the cause. If the issue you're facing seems different (eg no settings.xml involved), please open a separate ticket.

@mickaelistria
Copy link
Contributor

I think it's a symptom of eclipse/lemminx-maven#221 ; I hope to send some good news about it in the next hour or so ;)

@mickaelistria
Copy link
Contributor

m2e now uses a version of lemminx-maven which includes the potential fix. Please install latest snapshots from https://download.eclipse.org/technology/m2e/snapshots/latest/ and report whether this works better for you.

@bolbat
Copy link

bolbat commented Aug 30, 2021

Plugin updated to the latest snapshot
Screenshot 2021-08-30 at 18 41 18

But problem still exists
Screenshot 2021-08-30 at 18 41 40

@mickaelistria

@mickaelistria
Copy link
Contributor

Do you override the local repo or anything else non-standard that would prevent lemminx-maven from fetching the jar? Maybe some proxy or network settings?

@bolbat
Copy link

bolbat commented Aug 30, 2021

Do you override the local repo or anything else non-standard that would prevent lemminx-maven from fetching the jar? Maybe some proxy or network settings?

Configuration in .m2/settings.xml has company maven repository (Nexus based), last time changed years ago and works perfectly with any previous Eclipse version, problem only with m2e 1.18.x, with 1.17.x all works good

Configuration (.m2/settings.xml) looks like this (just removed URLs and credentials)

<settings xmlns="https://maven.apache.org/POM/4.0.0" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="https://maven.apache.org/POM/4.0.0
                      https://maven.apache.org/xsd/settings-1.0.0.xsd">
        <localRepository />
        <interactiveMode />
        <usePluginRegistry />
        <offline />
        <pluginGroups />
        <servers>
                <server>
                        <id>company-repo-id</id>
                        <username>company-user-name</username>
                        <password>company-user-pass</password>
                </server>
        </servers>
        <mirrors>
                <mirror>
                        <id>company-repo-id</id>
                        <url>https://company-repo-url</url>
                        <mirrorOf>*</mirrorOf>
                </mirror>
        </mirrors>
        <proxies />
        <profiles>
                <profile>
                        <activation>
                                <activeByDefault>true</activeByDefault>
                        </activation>
                        <repositories>
                                <repository>
                                        <id>company-repo-id</id>
                                        <url>https://company-repo-url</url>
                                        <releases>
                                                <enabled>true</enabled>
                                        </releases>
                                        <snapshots>
                                                <enabled>true</enabled>
                                        </snapshots>
                                </repository>
                        </repositories>
                </profile>
        </profiles>
        <activeProfiles />
</settings>

All dependent projects deployed locally and published to repository, also opened in Eclipse, everything builds in Eclipse and from console
Problem just with pom editor

@bolbat
Copy link

bolbat commented Aug 31, 2021

And also when i'm trying to open parent pom from editor by clicking (by cmd+click) on the parent section in current pom (on which i see error) - all works just fine, parent pom opening in separate window

@mickaelistria
Copy link
Contributor

The issue comes from LemMinX-Maven; and I think several of the issues reported here should now be resolved but your case is still failing (probably lemminx-maven is not handling well either the server part or the mirrors). It would be great if you could help in troubleshooting that in LemMinX-Mavne directly, by first reporting this issue to lemminx-maven and then trying to reduce this to a minimal portable reproducer.

@bolbat
Copy link

bolbat commented Sep 1, 2021

@mickaelistria reproducing is easy

Checkout and open the next projects in Eclipse as maven projects
https://code.solutionary.tech/projects/OS/repos/base-build-utils/browse (it's required as dependency for base-parent project)
https://code.solutionary.tech/projects/OS/repos/base-parent/browse

'base-parent' project is the base configuration for our company projects, it was based on org.sonatype.oss:oss-parent, which is accessible from maven central repository

Any configuration .m2/settings.xml can be disabled, i was renamed it to .m2/settings.xml.bak and rebuild project in Eclipse

And i see the next warnings:
Screenshot 2021-09-01 at 13 39 02

This warnings is the same symptoms of the editor problem as with "not resolving parent pom" error

Example for other internal project which is based on our 'base-parent' pom - you can see also the same warnings
Screenshot 2021-09-01 at 13 41 30

This mean you can create any other project based on 'base-parent' to reproduce this error or use the next project
https://code.solutionary.tech/projects/OS/repos/bom-logging-deps/browse
Screenshot 2021-09-01 at 14 05 39

As I see it's reproducing with single module and multi module projects, doesn't matter

With m2e v1.17.x everything works fine as expected without any errors and warnings

And also when i close editor with opened pom.xml in Eclipse - related errors and warnings in Problems window automatically clearing (but not always :( )

@bolbat
Copy link

bolbat commented Sep 1, 2021

My previous comment edited multiple times, now it's final

@fbricon
Copy link
Contributor

fbricon commented Sep 1, 2021

Until lemminx-maven is fixed, you can disable XML Language Server in the Language Servers preferences
Screenshot 2021-09-01 at 13 27 36

@bolbat
Copy link

bolbat commented Sep 1, 2021

Until lemminx-maven is fixed, you can disable XML Language Server in the Language Servers preferences

Thx, this was helpful

@mickaelistria
Copy link
Contributor

@bolbat I tried to reproduce with the steps described in #287 (comment) and couldn't see the "non-resolvable parent pom". In "Help > Installation Details", can you please verify that you have "POM Editor using LemMinX language server (includes Incubating components) 1.18.2.20210830-1339 org.eclipse.m2e.lemminx.feature.feature.group" with the same version?

This [Plugin could not be resolved] warnings is the same symptoms of the editor problem as with "not resolving parent pom" error

I don't think they're related. They seem like a distinct problem/fix.

@bolbat
Copy link

bolbat commented Sep 2, 2021

@bolbat I tried to reproduce with the steps described in #287 (comment) and couldn't see the "non-resolvable parent pom". In "Help > Installation Details", can you please verify that you have "POM Editor using LemMinX language server (includes Incubating components) 1.18.2.20210830-1339 org.eclipse.m2e.lemminx.feature.feature.group" with the same version?

Installed versions
Screenshot 2021-09-02 at 11 30 55

Today i've got updates
Screenshot 2021-09-02 at 11 47 15

Currently installed versions (after update)
Screenshot 2021-09-02 at 11 49 33

Checked with enabled "XML Language server" after update - situation is the same
Screenshot 2021-09-02 at 11 51 57

I don't think they're related. They seem like a distinct problem/fix.

I think they are related because with m2e (+ related plugins) on the v1.17.x no any error/warning in pom editor

P.S. If this can be helpful - we can make an online call/conversation with screen sharing and you can check everything on my local environment

@mickaelistria
Copy link
Contributor

I can now reproduce the issue, but it requires that the "child" pom is open before the parent one; once parent was open, any change on the child will make the warning disappear (because parent is now known to LemMinX-Maven).
This issue may be in m2e or LemMinX-Maven, I'm investigating.

The plugin resolution issue is independent of parent resolution and can be reproduce with a basic pom in LemMinX-Maven test suite, see eclipse/lemminx-maven#224

mickaelistria added a commit to mickaelistria/m2e-core that referenced this issue Sep 2, 2021
@mickaelistria
Copy link
Contributor

PR #316 reproduces the issue in a test case.

@eliasbalasis
Copy link

eliasbalasis commented Sep 2, 2021

If it helps you, under #152 I always open the parent project first and the problem is always reproducible, unless something has improved since last time I tried this (Apr. 8 2021)

@mickaelistria
Copy link
Contributor

unless something has improved since last time I tried this (Apr. 8 2021)

111 commits were merged since then. Please give a try to latest snapshots.

@mickaelistria
Copy link
Contributor

I think the root cause is in LemMinX-Maven: eclipse/lemminx#1110 . Because of it, the underlying language server is not informed about other local projects.

@c-koell
Copy link
Author

c-koell commented Oct 15, 2021

Should the latest Snapshot work now ?

@mickaelistria
Copy link
Contributor

Should the latest Snapshot work now ?

Partly. It should work if you 1st open the parent and then the child. The complete fix will require release of LemMinX and Wild Web Developer including it.

mickaelistria added a commit to mickaelistria/m2e-core that referenced this issue Nov 8, 2021
mickaelistria added a commit to mickaelistria/m2e-core that referenced this issue Nov 8, 2021
mickaelistria added a commit to mickaelistria/m2e-core that referenced this issue Nov 9, 2021
mickaelistria added a commit to mickaelistria/m2e-core that referenced this issue Nov 9, 2021
mickaelistria added a commit to mickaelistria/m2e-core that referenced this issue Nov 9, 2021
mickaelistria added a commit to mickaelistria/m2e-core that referenced this issue Nov 9, 2021
mickaelistria added a commit to mickaelistria/m2e-core that referenced this issue Nov 9, 2021
mickaelistria added a commit to mickaelistria/m2e-core that referenced this issue Nov 9, 2021
@mickaelistria
Copy link
Contributor

Patch was merged on master that should fix it; this will be available in https://download.eclipse.org/technology/m2e/snapshots/latest/ within a dozen of minutes.

@mickaelistria mickaelistria added this to the 1.18.3 milestone Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants