Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Exception trace
org.apache.maven.InternalErrorException: Internal error: java.lang.IllegalArgumentException: path cannot be null at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:157) at org.apache.maven.cling.invoker.mvn.DefaultMavenInvoker.doExecute (DefaultMavenInvoker.java:449) at org.apache.maven.cli.DaemonMavenInvoker.doExecute (DaemonMavenInvoker.java:135) at org.apache.maven.cli.DaemonMavenInvoker.doExecute (DaemonMavenInvoker.java:39) at org.apache.maven.cling.invoker.mvn.DefaultMavenInvoker.execute (DefaultMavenInvoker.java:104) at org.apache.maven.cling.invoker.mvn.DefaultMavenInvoker.execute (DefaultMavenInvoker.java:72) at org.apache.maven.cling.invoker.LookupInvoker.doInvoke (LookupInvoker.java:202) at org.apache.maven.cling.invoker.LookupInvoker.invoke (LookupInvoker.java:177) at org.apache.maven.cli.DaemonMavenCling.main (DaemonMavenCling.java:76) at org.mvndaemon.mvnd.daemon.Server.handle (Server.java:616) at org.mvndaemon.mvnd.daemon.Server.client (Server.java:292) at org.mvndaemon.mvnd.daemon.Server.lambda$accept$2 (Server.java:254) at java.lang.Thread.run (Thread.java:1583) Caused by: java.lang.IllegalArgumentException: path cannot be null at org.apache.maven.api.services.BaseRequest.nonNull (BaseRequest.java:50) at org.apache.maven.api.services.ModelSource.fromPath (ModelSource.java:57) at org.apache.maven.api.services.ModelSource.fromPath (ModelSource.java:52) at org.apache.maven.internal.impl.model.DefaultModelBuilder$DefaultModelBuilderSession.doReadFileModel (DefaultModelBuilder.java:1331) at org.apache.maven.internal.impl.model.DefaultModelCache$CachingSupplier.get (DefaultModelCache.java:178) at org.apache.maven.internal.impl.model.DefaultModelCache.computeIfAbsent (DefaultModelCache.java:65) at org.apache.maven.internal.impl.model.DefaultModelCache.computeIfAbsent (DefaultModelCache.java:56) at org.apache.maven.internal.impl.model.DefaultModelBuilder$DefaultModelBuilderSession.cache (DefaultModelBuilder.java:1654) at org.apache.maven.internal.impl.model.DefaultModelBuilder$DefaultModelBuilderSession.readFileModel (DefaultModelBuilder.java:1170) at org.apache.maven.internal.impl.model.DefaultModelBuilder$DefaultModelBuilderSession.loadFilePom (DefaultModelBuilder.java:727) at org.apache.maven.internal.impl.model.DefaultModelBuilder$DefaultModelBuilderSession.loadFromRoot (DefaultModelBuilder.java:705) at org.apache.maven.internal.impl.model.DefaultModelBuilder$DefaultModelBuilderSession.buildBuildPom (DefaultModelBuilder.java:652) at org.apache.maven.internal.impl.model.DefaultModelBuilder$1.build (DefaultModelBuilder.java:227) at org.apache.maven.project.DefaultProjectBuilder$BuildSession.build (DefaultProjectBuilder.java:491) at org.apache.maven.project.DefaultProjectBuilder$BuildSession.lambda$doBuild$5 (DefaultProjectBuilder.java:468) at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:197) at java.util.Collections$2.tryAdvance (Collections.java:5073) at java.util.Collections$2.forEachRemaining (Collections.java:5081) at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:509) at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:499) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential (ReduceOps.java:921) at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.collect (ReferencePipeline.java:682) at org.apache.maven.project.DefaultProjectBuilder$BuildSession.doBuild (DefaultProjectBuilder.java:470) at org.apache.maven.project.DefaultProjectBuilder$BuildSession.build (DefaultProjectBuilder.java:444) at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:183) at org.apache.maven.project.collector.DefaultProjectsSelector.selectProjects (DefaultProjectsSelector.java:61) at org.apache.maven.project.collector.RequestPomCollectionStrategy.collectProjects (RequestPomCollectionStrategy.java:49) at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor (DefaultGraphBuilder.java:364) at org.apache.maven.graph.DefaultGraphBuilder.build (DefaultGraphBuilder.java:100) at org.apache.maven.DefaultMaven.buildGraph (DefaultMaven.java:629) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:250) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:225) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:149) at org.apache.maven.cling.invoker.mvn.DefaultMavenInvoker.doExecute (DefaultMavenInvoker.java:449) at org.apache.maven.cli.DaemonMavenInvoker.doExecute (DaemonMavenInvoker.java:135) at org.apache.maven.cli.DaemonMavenInvoker.doExecute (DaemonMavenInvoker.java:39) at org.apache.maven.cling.invoker.mvn.DefaultMavenInvoker.execute (DefaultMavenInvoker.java:104) at org.apache.maven.cling.invoker.mvn.DefaultMavenInvoker.execute (DefaultMavenInvoker.java:72) at org.apache.maven.cling.invoker.LookupInvoker.doInvoke (LookupInvoker.java:202) at org.apache.maven.cling.invoker.LookupInvoker.invoke (LookupInvoker.java:177) at org.apache.maven.cli.DaemonMavenCling.main (DaemonMavenCling.java:76) at org.mvndaemon.mvnd.daemon.Server.handle (Server.java:616) at org.mvndaemon.mvnd.daemon.Server.client (Server.java:292) at org.mvndaemon.mvnd.daemon.Server.lambda$accept$2 (Server.java:254) at java.lang.Thread.run (Thread.java:1583)
Reason: is usually project formatted like this:
worx .mvn prj1 pom.xml prj2 pom.xml
At level of .mvn there is no POM.
IMHO this is valid layout. Maven should not expect that there is pom.xml where .mvn directory is. Is like is mixing rootDirectory and topDirectory?
Also, as we discussed, Maven could come up with generated on the fly POMs for such directories, to be able to build the complete tree structure: these POMs are not parents (otherwise they would be referenced from prj1 or prj2 and they missing would mean project is broken). They are really "just aggregator" POMs, but subprojects can today be inferred, it means they need GA only, V=1 and packaging=pom.
This means maven could generate these in memory with random G and V=relativized path from rootDirectory parent?