1
I found this problem at first, but I have replaced the image with Ali’s, as follows:
①, open the following directory: your maven file path/conf/setting.xml
I sudo apt-get install maven
installed maven using the command, so the default directory path of maven at: /usr/share/maven
. As shown in the figure below:
use the command: sudo vim setttings.xml
open the file.
②I created a directory to store the data downloaded by maven, and made the following changes in settings.xml:
③Find the mirror and add the following code into it:
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
<mirrorOf>central</mirrorOf>
</mirror>
As shown in the figure below:
But when I run ideal, there will still be problems with the title. And finally there is no such file .
2
It took me a long time before I suddenly remembered that as long as the ubuntu system does not read and write files under the root user, you need to unlock the permissions of the files first (centos is used too much, I can’t remember it at all), so you only need to use the following command to convert ordinary users
to Change the read and write permission of the file to open:
sudo chmod 777 /usr/share/maven/Repository
open the file permission, so that maven can read and write the Repository folder. After running the maven program again, it succeeded.