Get the App
SLTechnology News&Howtos  ›  Development  › 

Detailed explanation of common exceptions and solutions in Java development

Shulou Source: shulou.com Published: 2022-06-03 19:10:44 10月03日 Update

This article mainly explains the "detailed explanation of common exceptions and solutions in Java development". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "detailed explanation of common anomalies and solutions in Java development".

Catalogue

1.Failed to read artifact descriptor for

(1) add a new profile to set the mirror source

(2) IDEA to operate

1.Failed to read artifact descriptor for

When you create a Maven project in IDEA and introduce dependencies in pom.xml, you sometimes get an error Failed to read artifact descriptor for xxx.

This may be due to a problem with the configured image. The resolution process is as follows:

(1) add a new profile to set the mirror source

Add the following to the settings.xml configuration file under the C:\ Users\ Administrator\ .m2 directory (Lenovo is C:\ Users\ LENOVO\ .m2):

Alimaven aliyun maven http://maven.aliyun.com/nexus/content/repositories/central/ central

If this file does not exist before, you need to create the file first, and then configure it as follows:

Alimaven aliyun maven http://maven.aliyun.com/nexus/content/repositories/central/ central

Ali's mirror source is set up here.

(2) IDEA to operate

After IDEA opens the project, select Maven on the right, click open, and then open Lifecycle, as follows:

You can see clean, validate, compile, and so on.

Right-click clean and select Run 'project [clean]' (project is the actual name of the project), as follows:

Right-click install, and select Run 'project [install]', as follows:

This process takes a long time. If you encounter a situation where a jar package cannot be downloaded, you can download it manually and place it in the local C:\ Users\ LENOVO\ .m2\ repository directory.

Reload all Maven projects

Because the Maven source is reconfigured, Maven needs to reload the dependency, as follows:

Restart

Since the dependencies set may not take effect immediately after the project is reloaded, you may need to restart IDEA, as shown below:

Wait for the restart, and then check. If you still can't import the dependency, you can choose to restart your computer and try again.

Thank you for your reading, the above is the content of "detailed explanation of common exceptions and solutions in Java development". After the study of this article, I believe you have a deeper understanding of the common exceptions and solutions in Java development, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Configuration files projects methods common development images content directories learning situations processes problems right name actual that is ideas manual articles Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Shulou Tech Info MySQL OPPO Reno Apple