After updating to Catalina I get the following error when running mvn clean install
from the terminal:
The goal you specified requires a project to execute but there is no POM in this directory (/private/var/folders/xs/lgy9yxv501xcvnqr_zhg85wr0000gn/T/hsperfdata_user1). Please verify you invoked Maven from the correct directory.
The current directory contains a pom.xml and a valid project
user1@xyz project1 % pwd
/Users/user1/Documents/project/project1
user1@xyz project1 % ls
README.md pom.xml project1-service
I've tried mvn clean install -f pom.xml
as well. This will error with:
The project (/Users/user1/Documents/project/project1/pom.xml) has 1 error
[ERROR] Non-readable POM /Users/user1/Documents/project/project1/pom.xml: /Users/user1/Documents/project/project1/pom.xml (Operation not permitted)
This works just fine from InteliJ's terminal. Any idea what happened?
If you get mvn command not found when you run a maven command on macOS or any bash terminal then you have not set the PATH for maven home. Note that it is better to set the path details in the ~/. zshrc file to make it permanent.
Once Maven is installed, you can check the version by running mvn -v from the command-line.
What I ended up doing was to System Preferences->Security & Privacy->Full Disk Access
and add Terminal there. Apparently with Catalina you have to manually grant access to apps that access user files.
I had the same problem, but the cause of it was different.
My maven was installed outside of usual directories under /apps/
.
The system upgrade wiped everything it didn't see appropriate. All custom directories were simply gone. Maven had to be re-installed using brew install maven
.
UPDATE:
The files haven't been deleted. Instead, they've been relocated to /Users/Shared/Previously Relocated Items
, which prevents executables from being found, but the files are not completely lost. You can take what you need from that folder, but in case of maven you can just delete it and install anew using brew with my instruction above.
Here's the explanation for why Catalina has done it: https://www.macrumors.com/guide/relocated-items/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With