ltearno / pom-explorer

A tool to aid managing lots of maven projects
MIT License
371 stars 65 forks source link

'analyze directory' Error on Mac monterey #96

Open christopinka opened 2 years ago

christopinka commented 2 years ago

Getting below when fetching pom file for gav com.xxx:parent:2.0.6. Thanks


analyze directory /Users/xxx/auto-clone-xxx
Analyzing directory '/Users/xxx/auto-clone-xxx'...
possible options: verbose, nofetch, offline, profiles
analyzing '/Users/xxx/auto-clone-xxx'
Pom Analysis ready!
adding directory '/Users/xxx/auto-clone-xxx'
found 73 pom files
loading pom files
loaded 73 projects

completing loaded projects
fetching pom file for gav com.xxx:parent:2.0.6
Error when interpreting command 'analyze directory /Users/xxx/auto-clone-xxx'
Command class : AnalyzeCommand
Command method : directory
Argument : class: fr.lteconsulting.pomexplorer.commands.CommandOptions toString : fr.lteconsulting.pomexplorer.commands.CommandOptions@41e98378
Argument : class: fr.lteconsulting.pomexplorer.Client toString : fr.lteconsulting.pomexplorer.Client@4d48daed
Argument : class: fr.lteconsulting.pomexplorer.ApplicationSession toString : fr.lteconsulting.pomexplorer.ApplicationSession@7de963e6
Argument : class: fr.lteconsulting.pomexplorer.AppFactory$2 toString : fr.lteconsulting.pomexplorer.AppFactory$2@77a93ef0
Argument : class: java.lang.String toString : /Users/ctopinka/auto-clone-rqns
java.lang.NullPointerException: repository system session cannot be null
java.util.Objects.requireNonNull(Objects.java:228)
org.eclipse.aether.internal.impl.DefaultRepositorySystem.validateSession(DefaultRepositorySystem.java:431)
org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:261)
org.jboss.shrinkwrap.resolver.impl.maven.bootstrap.MavenRepositorySystem.resolveArtifact(MavenRepositorySystem.java:135)
fr.lteconsulting.pomexplorer.MavenResolver.resolvePom(MavenResolver.java:113)
fr.lteconsulting.pomexplorer.DefaultPomFileLoader.loadPomFileForGav(DefaultPomFileLoader.java:30)
fr.lteconsulting.pomexplorer.PomAnalysis.loadAndCheckProject(PomAnalysis.java:419)
fr.lteconsulting.pomexplorer.PomAnalysis.processProjectForCompleteness(PomAnalysis.java:381)
fr.lteconsulting.pomexplorer.PomAnalysis.completeLoadedProjects(PomAnalysis.java:248)
fr.lteconsulting.pomexplorer.PomAnalysis.runFullRecursiveAnalysis(PomAnalysis.java:66)
fr.lteconsulting.pomexplorer.commands.AnalyzeCommand.directory(AnalyzeCommand.java:29)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
fr.lteconsulting.pomexplorer.commands.Commands.takeCommand(Commands.java:251)
fr.lteconsulting.pomexplorer.AppFactory$1.onWebsocketMessage(AppFactory.java:177)
fr.lteconsulting.pomexplorer.webserver.WebServer$2$1.lambda$onFullTextMessage$0(WebServer.java:145)
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:750)
christopinka commented 2 years ago

multi module project is kinda fighting me in intellij. Not sure what's up. mvn clean install succeeds but project is broken in intellij. Lots of errors like 'java: package org.apache.maven.model does not exist'. Haven't had this problem with intellij and multi module recently. Thoughts? Latest intellij. Java 8. Maven 3.8.6.

Appears to be conventional project structure.

Some progress. Intellij doesn't seem to like the discrepancy between the project name and parent name. Oh well. But now getting Could not find or load main class fr.lteconsulting.pomexplorer.PomExporerApp.

This is just an ide problem. The above is still an issue though. How do I go about debugging? Is there a non ui way to do this? Thanks

christopinka commented 2 years ago

I think I'm just missing that version number in my local repo

fetching pom file for gav com.xxx:parent:2.0.6

Strange message if that's it.

It does appear to be the problem; if the dependency isn't installed locally.

There may be an improvement here. To log more meaningful message in the console when this happens. Also, it seems like a pre-requisite to have all dependencies installed locally. The documentation could be updated to state that. In my case this would mean clean install on ~80 projects that I'm interested in. is it possible to try and fetch the dependency from remote if it's not available in local? There may be a command option that does this already.

Does it respect my .m2/settings.xml?

christopinka commented 2 years ago

After setting maven settings in config.properties I'm getting further. After many unresolvable and duplicate messages I get

analysis report:
73 projects loaded and added to the pom graph,
111 projects added to graph,
in 10223 ms.
Analysis completed.

But I'm unable to see graph in the browser in the 'graph' tab. Using chrome. Same in Safari.