Article directory
1. Reproduce the error
gitlab
After downloading the project from the upload today , the project cannot be started. Notice the one in the lower right corner Evnet Log
, and click to open it, as shown in the figure below:
ie Unable to import maven project: See logs for details
.
2. Analysis errors
Will be Unable to import maven project: See logs for details
translated into Chinese, that is无法导入maven项目:参阅日志
So, how to refer to the log? Opening , as shown idea
below Help -> show Log in Explorer
:
Open the log and find a bunch of error messages, as shown in the following figure:
According to the error message in the red box, I can't connect to Google's services, why can't I connect to Google's services? But I didn't take the initiative to connect to Google's services.
Some of the mirrors that our project relies on are foreign. For example, some frameworks are open sourced by Google, so foreign mirrors sometimes have different networks.
So, how do we solve this problem?
3. Solve the problem
I provide the following two solutions to solve the current error.
3.1 Solution 1
Use idea
the one that comes with the editor maven
.
We use CTRL + ALT + S
the shortcut key to open the setting panel ( Settings
), Settings
find it in the setting panel ( ) Build, Execution, Deployment -> Build Tools -> Maven
, and Maven home directory
modify it to the system's own, as shown in the following figure:
Click OK
to resolve the error.
If your CTRL + ALT + S
shortcut keys conflict, you can use the following method to open the settings panel ( Settings
):
3.2 Solution 2
Instead of using idea
the built-in one maven
, we still use our own installation maven
.
- First open
maven
the configuration file (settings.xml
)
If you Maven
don't have it Open 'settings.xml'
, you can find it in the files maven
in your installation directory conf
.
For example, in my maven
installation directory D:\software\apache-maven-3.8.1
, then I will conf
search for the files in the directory, that is D:\software\apache-maven-3.8.1\conf
, as shown in the following figure:
- Then in
settings.xml
the file, change the mirror address to the Alibaba Cloud mirror address.
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
- Finally, reimport the package
4. Supplementary Notes
There are also some points to pay attention to, idea
which are cached.
After you modify it, clear the cache and restart as shown in the screenshot below:
There is another place that will also affect the setting problem. My idea
default setting is , but it does not meet our needs, so it is better to set it to , as shown in the following figure:settings -> build,execution,Deployment -> Build Tools -> Maven -> importing
JDK for importer
jre
jre
jdk