Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any difference between run maven as sudo and without sudo?

Tags:

maven

I am using maven and JavaFX Maven Plugin. Maven will download jar from repository and save it to ~/.m2 directory. But if I use maven as sudo. For example, if I type sudo mvn com.zenjava:javafx-maven-plugin:2.0:fix-classpath, is there any difference with the command without sudo? Does maven download the plugin and save it to ~/.m2 as well?

I ask this question because I run this command both under sudo and no-sudo. It seems maven will re-download the plugin each time.

like image 260
Ciel Avatar asked Sep 05 '25 03:09

Ciel


1 Answers

I think your question is related to this one.
So the answer to your question, would be if you are not changing the home directory while executing sudo, maven will download plugins to your user .m2 directory.

like image 189
Carlo Avatar answered Sep 09 '25 00:09

Carlo