Summary of solutions to the problem that Maven dependency packages cannot be downloaded in IDEA

The problem that this dependency package cannot be downloaded is really annoying. I have been cutting and pasting the dependencies that cannot be downloaded before into the pom.xml file, saving it and downloading it automatically, but today, it is useless to cut and paste, so It took some time to search for solutions on the Internet, and after trying some, I finally solved the problem fundamentally, so I wrote a blog to summarize the solutions to this problem!


1. First, refresh the two positions on the map with some crazy points, and then the eggs...


So I followed the instructions on the blog to find Settings -> Build, Execution, Deployment -> Build Tools -> Maven -> Ignored Files 

As shown below:


However, this still doesn't help me, but I still have to record it, and thank this blogger brother!!!

Original address: https://blog.csdn.net/qq_35981283/article/details/73928035


2. After that, I found something about configuration, Settings -> Build, Execution, Deployment -> Build Tools -> Maven -> Importing, as shown below:


However...still useless...At this step, I found that the settings are all set, although these settings did not solve my problem, but I still need to record it, maybe someone will be caused by the setting problem Dependency package cannot be downloaded...


3. The point is here, this time I found another blog, which completely solved my problem. Right-click on the Maven project, and the operation is as follows:


Click Open'settings.xml', the location is Create 'settings.xml' at the beginning, after opening, add the mirror server in it:


Then, I reimported according to the previous method, and the dependency package finally began to download!!! The inner cow is full of faces... Maybe everyone has set this up, but I still need to record it. After all, it really solved me. The problem, attach a code:

    <mirrors>
        <mirror>
            <id>nexus</id>
            <name>internal nexus repository</name>
            <!-- <url>http://192.168.1.100:8081/nexus/content/groups/public/</url>-->
            <url>http://repo.maven.apache.org/maven2</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
    </mirrors>

Original address: https://blog.csdn.net/sky19891212/article/details/43924831

Thank you so much for this blogger bro!!! 


4.. After I finally downloaded it, I found that the report on the right is red, am I blind, am I blind, am I blind... 


Then I searched online and found two solutions:

    1. Delete the corresponding dependencies in pom.xml first, then refresh the right side, then paste the dependencies into pom.xml, and refresh the right side again.

    2. Delete the corresponding package from the local warehouse, and then let maven download it again

Original address: https://blog.csdn.net/u010003835/article/details/78480626

Thanks also to this blogger brother!!!


After this, I may no longer have to worry about the problem of dependent package downloads, and I am very happy...


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324855379&siteId=291194637