gnodet commented on PR #1389:
URL: https://github.com/apache/maven/pull/1389#issuecomment-1910191595

   > Just FTR as we discussed:
   > 
   > * IMHO baseDir != "pom file parent"
   > * especially as a project may (could) have baseDir but no POM file (but 
have model provided)
   > * possible use case: generate some POM (ie is in tmp directory), create a 
Project that is "placed" on top of some existing module, and have it built?
   
   So we're looking at Maven being used as a library, right ? That's clearly 
not supported from the CLI.
   Right, now, in the Maven 4 API (let's limit to that use case) the only way 
to obtain a `Project` is by using the `ProjectBuilder` and the only way to use 
it is to give either a `Path`, `Source`, `Artifact` or `ArtifactCoordinate`.
   My understanding (it closely maps the v3 api) is that it you pass an 
ArtifactCoordinate (or Artifact), that artifact is resolved (it must point to a 
POM), then loaded.  I need to double check, but this results in a `Project` 
which has no POM file and no BaseDir.
   I think that's the current situation, i.e.: either you have both or none, 
but it's linked.  The POM file cannot point to the local repository, it's 
*always* a build POM in your project file system, and it always define the base 
directory.
   
   I'll also double check the `DefaultMavenProjectBuilder`.  But I'm sure the 
use case you describe is currently supported.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to