Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Unable to find the root directory" in multi-module build #901

Open
calle2010 opened this issue Nov 2, 2023 · 3 comments
Open

"Unable to find the root directory" in multi-module build #901

calle2010 opened this issue Nov 2, 2023 · 3 comments

Comments

@calle2010
Copy link

In different projects with multiple modules mvnd 1.0-m7 prints in the first line

Unable to find the root directory. Create a .mvn directory in the root directory or add the root="true" attribute on the root project's model to identify it.

But Maven 4.0.0-alpha-8 doesn't complain. In both cases Maven is started from the project root directory. Creating the ".mvn" directory doesn't mute the message printed by mvnd.

$ mvnd -1 -DskipTests clean compile
Unable to find the root directory. Create a .mvn directory in the root directory or add the root="true" attribute on the root project's model to identify it.
[INFO] Processing build on daemon 85f9f7c1
[INFO] Scanning for projects...
[INFO] BuildTimeEventSpy is registered.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
^C

$ mvn -DskipTests clean compile
[INFO] Scanning for projects...
[INFO] ----------------------------------------------------------------------------------------------------------------
[INFO] Reactor Build Order:
^C

$ mvnd -v
Unable to find the root directory. Create a .mvn directory in the root directory or add the root="true" attribute on the root project's model to identify it.
Apache Maven Daemon (mvnd) 1.0-m7 linux-amd64 native client (b2ef5d81997adbcdb72dc8c5603722538fa641fe)
Terminal: org.jline.terminal.impl.PosixSysTerminal with pty org.jline.terminal.impl.jansi.linux.LinuxNativePty
Apache Maven 4.0.0-alpha-7 (bf699a388cc04b8e4088226ba09a403b68de6b7b)
Maven home: /home/wsl/bin/maven-mvnd-1.0-m7-m40-linux-amd64/mvn
Java version: 21.0.1, vendor: Eclipse Adoptium, runtime: /usr/lib/jvm/temurin-21-jdk-amd64
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.15.90.1-microsoft-standard-wsl2", arch: "amd64", family: "unix"

$ mvn -v
Apache Maven 4.0.0-alpha-8 (a2cbf4873a99c1aca7e3908086fe53b17865f07a)
Maven home: /home/wsl/bin/apache-maven-4.0.0-alpha-8
Java version: 21.0.1, vendor: Eclipse Adoptium, runtime: /usr/lib/jvm/temurin-21-jdk-amd64
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.15.90.1-microsoft-standard-wsl2", arch: "amd64", family: "unix"
@calle2010
Copy link
Author

same behavior in mvnd 1.0-m8

@ppalaga
Copy link
Contributor

ppalaga commented Dec 6, 2023

Thanks for the report, @calle2010!

Creating the .mvn directory should solve the issue. I wonder whether there some kind of git push/pull in between that ignores empty directories?

@slawekjaranowski
Copy link
Member

It was changed in alpha-8 - https://issues.apache.org/jira/browse/MNG-7898 - massage is printed in Debug level.
but there is proposition to change level: https://issues.apache.org/jira/browse/MNG-7919

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants