This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven.git
The following commit(s) were added to refs/heads/master by this push:
new 6b3989ce5 Use model processor when locating the root pom when using
-f/--file
6b3989ce5 is described below
commit 6b3989ce5b43e2dd178d8c88195f4c2a355a44b9
Author: Guillaume Nodet <[email protected]>
AuthorDate: Fri Jun 30 15:30:38 2023 +0200
Use model processor when locating the root pom when using -f/--file
---
maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
index a4ad1d23f..10fc18c8f 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
@@ -1352,7 +1352,11 @@ public class MavenCli {
if (alternatePomFile != null) {
File pom = resolveFile(new File(alternatePomFile),
workingDirectory);
if (pom.isDirectory()) {
- pom = new File(pom, "pom.xml");
+ if (modelProcessor != null) {
+ pom = modelProcessor.locatePom(pom);
+ } else {
+ pom = new File(pom, "pom.xml");
+ }
}
return pom;