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

Dependency is not resolved when in non-public nexus (causing ctrl-hover not working) #959

Open
ca-stefan-cordes opened this issue Oct 1, 2022 · 5 comments

Comments

@ca-stefan-cordes
Copy link

We have some dependencies and parents in our non-public available nexus repository and the m2e plugin does not find the parent even the repository is in my user settings.xml

	<profiles>
		<profile>
			<id>default</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<repositories>
				<repository>
					<id>nexus-public-proxy-repo</id>
					<name>nexus-public-proxy-repo</name>
					<url>https://nexus.canda.com/repository/public</url>
				</repository>
			</repositories>

The com\retail-sc\maven-base\2020.9.1-1 is fine, too _remote.repositories

#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
#Sat Oct 01 10:53:39 CEST 2022
maven-base-2020.9.1-1.pom>nexus-public-proxy-repo=

Failure even after "Force Update Snapshots"

image

mvn compile works fine on console
image

Workaround is to force reading all artifacts with a mirror statement:

	<mirrors>
	     <mirror>
			<id>centralMirror</id>
			<mirrorOf>*</mirrorOf>
			<name>Local m2 Mirror</name>
			<url>https://nexus.canda.com/repository/public</url>
		</mirror>
	</mirrors>

(Drawback is that our nexus would need to handle all traffic and all artifacts)

With mirror the error is gone and the Ctrl-Hover is working as expected:
image

Eclipse Version: 2022-06 (4.24.0)
Build id: 20220609-1112

installed-m2e-versions

@mickaelistria
Copy link
Contributor

Can you please go to the Problems view and show the full line with details for the marker you're seeing? The error may come from m2e, or from the underlying LemMinX langage server used by the editor. The problem details will help to figure that out.

@ca-stefan-cordes
Copy link
Author

image

Non-resolvable parent POM for com.retail-sc.commons:rsc-base-types:${revision}: Could not find artifact com.retail-sc:maven-base:pom:2020.9.1-1 in central (https://repo.maven.apache.org/maven2)

Type is "Language Servers"

@Renan-Di
Copy link

Any updates on the problem? Same situation here, we have an internal repo configured in a profile activated by properties inside our settings.xml.
Eclipse build and artifact resolution is fine, but trying to open pom editor rises the error(Non resolvable pom parent) or using Maven > Select active profiles, when closing the editor the error disapears. We are currently in version 2.2, in an older version of m2e plugin(1.6) it works fine, also deleting the file _remote.repositories causes the error to disapear until next time we redownload this artifact.

.log

!ENTRY org.eclipse.m2e.profiles.ui 4 0 2023-04-28 10:40:51.254
!MESSAGE Unable to open the Maven Profile selection dialog
!STACK 1
org.eclipse.core.runtime.CoreException: Could not resolve artifact com.example:super_parent_pom:pom:0.22.0
	at org.eclipse.m2e.core.internal.embedder.MavenImpl.lambda$6(MavenImpl.java:584)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:394)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:275)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:214)
	at org.eclipse.m2e.core.internal.embedder.MavenImpl.resolve(MavenImpl.java:553)
	at org.eclipse.m2e.core.internal.embedder.MavenImpl.resolve(MavenImpl.java:538)
	at org.eclipse.m2e.profiles.core.internal.management.ProfileManager.resolvePomModel(ProfileManager.java:380)
	at org.eclipse.m2e.profiles.core.internal.management.ProfileManager.buildParentModel(ProfileManager.java:255)
	at org.eclipse.m2e.profiles.core.internal.management.ProfileManager.getModelHierarchy(ProfileManager.java:235)
	at org.eclipse.m2e.profiles.core.internal.management.ProfileManager.getModelHierarchy(ProfileManager.java:237)
	at org.eclipse.m2e.profiles.core.internal.management.ProfileManager.getProfileDatas(ProfileManager.java:147)
	at org.eclipse.m2e.profiles.ui.internal.actions.ProfileSelectionHandler$GetProfilesJob.getAllProfiles(ProfileSelectionHandler.java:283)
	at org.eclipse.m2e.profiles.ui.internal.actions.ProfileSelectionHandler$GetProfilesJob.run(ProfileSelectionHandler.java:199)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Contains: Missing com.example:super_parent_pom:pom:0.22.0
!SUBENTRY 1 org.eclipse.m2e.core 4 -1 2023-04-28 10:40:51.255
!MESSAGE Could not resolve artifact com.example:super_parent_pom:pom:0.22.0
!SUBENTRY 2 org.eclipse.m2e.core 4 0 2023-04-28 10:40:51.255
!MESSAGE Missing com.example:super_parent_pom:pom:0.22.0

@laeubi
Copy link
Member

laeubi commented May 2, 2023

Any updates on the problem? Same situation here, we have an internal repo configured in a profile activated by properties inside our settings.xml.

If you want to push this forward, the best would be to provide a test or at least a reproducer project.

@pbodnar
Copy link

pbodnar commented Jul 5, 2023

Hi, I don't have an exact reproducer, but if it helps, here are some related problems observed:

If there is an error downloading an artifact from a repository and the artifact is successfully downloaded from another repository thereafter (because of changing available repositories in settings.xml), it looks like the m2e's (or LemMinX's?) language server is not able to cope with this until I restart the whole Eclipse. I.e. no matter what I do, I keep getting this error:

Non-resolvable parent POM for org.apache.logging.log4j:log4j:2.20.1-SNAPSHOT: The following artifacts could not be resolved: org.apache.logging:logging-parent:pom:9 (present, but unavailable): org.apache.logging:logging-parent:pom:9 failed to transfer from https://repo.example.com/nexus/content/groups/public during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of nexus has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.logging:logging-parent:pom:9 from/to nexus (https://repo.example.com/nexus/content/groups/public): Access denied to https://repo.example.com/nexus/content/groups/public/org/apache/logging/logging-parent/9/logging-parent-9.pom. Error code 403,

I think this differs from the "good old days" (2020 - 2021?) before the LS got introduced, when it was enough just to remove the infamous _remote.repositories file (or maybe another one, not sure now) from the given .m2 artifact folder and run "Update Maven Project" in Eclipse. Now it looks like Eclipse remembers the download failure "forever" - until it gets stopped.

Also, I'm not sure if this issue cannot be somehow behind the LS slow start: eclipse/lemminx-maven/issues/406. On the project I had the problem described above, it took even about 20 minutes (!) until getting rid of "Could not get hover information due to timeout after 1000 miliseconds" and Eclipse finally started to show hovers in the POM editor. Interestingly enough, the LS Java process used less then 0,5% CPU for all that time - some temporary deadlock, networking issue?

UPDATE: The trick with turning OFF "Preferences => XML (Wild Web Developer) => Validation & Resolution => Enable Validation" (as mentioned in the linked issue) doesn't help either.

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

5 participants