bnd icon indicating copy to clipboard operation
bnd copied to clipboard

Seeing [FATAL] Non-readable POM in a plain bnd workspace

Open chrisrueger opened this issue 3 years ago • 4 comments

I was building master (dbf5fb4ddbb5ca0d2cc3292bdff0433e4f781949) locally two days ago to get the recent changes and play around with it and I noticed the following error in Eclipse error view - which I think I have not seen in 6.1.

None of my bundles have a pom.xml - we are using a plain bnd workspace with a cnf folder.

So I think what I am wondering is, why am I seeing an error which seems to be related to maven.

  • Bndtools 6.3.0.DEV-202202190307-ge58c49a

image

image

org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[FATAL] Non-readable POM .... (No such file or directory) @ 

	at org.eclipse.m2e.core.internal.embedder.MavenImpl.readMavenProjects(MavenImpl.java:696)
	at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.lambda$13(ProjectRegistryManager.java:864)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:182)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:156)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:103)
	at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.execute(ProjectRegistryManager.java:1022)
	at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.readProjectsWithDependencies(ProjectRegistryManager.java:860)
	at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.readProjectWithDependencies(ProjectRegistryManager.java:829)
	at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.lambda$22(ProjectRegistryManager.java:1064)
	at com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4853)
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3529)
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2278)
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2155)
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2045)
	at com.google.common.cache.LocalCache.get(LocalCache.java:3951)
	at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4848)
	at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.getMavenProject(ProjectRegistryManager.java:1063)
	at org.eclipse.m2e.core.internal.project.registry.MavenProjectFacade.getMavenProject(MavenProjectFacade.java:261)
	at bndtools.m2e.MavenRunListenerHelper.getMavenProject(MavenRunListenerHelper.java:59)
	at bndtools.m2e.MavenBndrunContainer.getBndrunContainer(MavenBndrunContainer.java:105)
	at bndtools.m2e.MavenDependenciesRepository.collect(MavenDependenciesRepository.java:50)
	at bndtools.m2e.MavenWorkspaceRepository.process(MavenWorkspaceRepository.java:369)
	at bndtools.m2e.MavenWorkspaceRepository.process(MavenWorkspaceRepository.java:361)
	at org.osgi.util.promise.DeferredPromiseImpl$Submit.run(DeferredPromiseImpl.java:755)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
	at java.base/java.lang.Thread.run(Thread.java:832)


chrisrueger avatar Feb 21 '22 13:02 chrisrueger

It looks like Eclipse m2e is telling Bndtools m2e the project is a maven project, so Bndtools m2e is asking Eclipse m2e for information about the maven project.

https://github.com/bndtools/bnd/blob/dbf5fb4ddbb5ca0d2cc3292bdff0433e4f781949/bndtools.m2e/src/bndtools/m2e/MavenWorkspaceRepository.java#L360

I assume your projects do not have org.eclipse.m2e.core.maven2Nature nature in their .project files?

In any case, this would seem to be an Eclipse m2e issue since it is telling Bndtools m2e the project is a maven project.

None of my bundles have a pom.xml - we are using a plain bnd workspace with a cnf folder.

You can avoid this by not installing the Bndtools m2e feature which you don't need.

bjhargrave avatar Feb 21 '22 14:02 bjhargrave

I assume your projects do not have org.eclipse.m2e.core.maven2Nature nature in their .project files?

Correct.

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
	<name>com.synesty.utils.csvconverter</name>
	<comment></comment>
	<projects>
	</projects>
	<buildSpec>
		<buildCommand>
			<name>org.eclipse.jdt.core.javabuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>bndtools.core.bndbuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
	</buildSpec>
	<natures>
		<nature>org.eclipse.jdt.core.javanature</nature>
		<nature>bndtools.core.bndnature</nature>
	</natures>
</projectDescription>

You can avoid this by not installing the Bndtools m2e feature which you don't need.

Ah makes sense. Maybe this is the difference to earlier, when I have installed bndtools from the official release. I have uninstalled bndtools m2e and have not seen this error again.

chrisrueger avatar Feb 21 '22 15:02 chrisrueger

I'll check to see if somewhere we're missing a check on whether a project is in fact a maven project or not. Oddly, I have not seen this behaviour myself. If there's any chance of getting a reproducer project that would be ideal.

rotty3000 avatar Feb 21 '22 16:02 rotty3000

Sorry, unfortunately I don't have a reproducer repo at hand. It only happened because I accidentally installed bndtools m2e. I have not done this before as I haven't needed it so far. I am also not sure what kind of problem this causes. I was just stumbeling upon it while chasing a weird behaviour which I thought at first was related to the new bndtools 6.3. version but turned out it was a completely unrelated mistake by me. But I just wanted to report it.

chrisrueger avatar Feb 21 '22 23:02 chrisrueger

closing this, not sure anything will ever happen here. Can always be reopened

pkriens avatar Feb 23 '23 11:02 pkriens