Easily solve the problem that Maven cannot download the source code in Idea

 Today when I was solving a problem, I wanted to download the source code. I suddenly found that the idea could not be downloaded. This was really painful. I had no way to check the cause. Finally, I found that the cause of the problem was actually Maven. Because I used the Maven built-in Bundle3 of the idea. , I have never studied the difference between local installation and built-in before. Today I just have this opportunity to take a look at the problem.

1. The installation location of Maven in idea

The location of maven in idea is \plugins\maven in your idea installation directory. 

My local address: D:\JetBrains\IntelliJ IDEA 2023.1\plugins\maven\lib\maven3

When using the mvn command in idea, it will prompt that the command does not exist. This is because Maven is not in the environment variables and can be added to the system environment variables.

 Just execute it again

2. Maven cannot download the source code

Maven cannot download the source code because the settings used by Maven need to be commented out.

I don’t know why this configuration exists. It is said to be for security.

  <mirror>
      <id>maven-default-http-blocker</id>
      <mirrorOf>external:http:*</mirrorOf>
      <name>Pseudo repository to mirror external repositories initially using HTTP.</name>
      <url>http://0.0.0.0/</url>
      <blocked>true</blocked>
    </mirror>

 Remember to restart IDEA! Otherwise, the configuration before modification will remain.

If you are using Maven installed by yourself, you can use the following command. Remember to add Maven to the Path. This can also solve the problem of downloading the source code.

mvn dependency:resolve -Dclassifier=sources


brief introduction

This book starts from the basic concepts of distributed systems, and gradually goes into the advanced practice of distributed system middleware Spring Cloud Alibaba . It focuses on the complete process of integrating various distributed components using the Spring Cloud Alibaba framework, so that readers can not only systematically Learn relevant knowledge about distributed middleware,

It can also provide a deeper understanding of business logic analysis ideas and practical application development.

The book is divided into 5 chapters. The beginning of Chapter 1 explains the evolution process of distributed systems, Spring Cloud Alibaba overview and version selection, as well as the advantages and disadvantages of monolithic architecture / microservice architecture; Chapter 2 explains how to use Spring Cloud Alibaba implements RPC communication; when introducing the mainstream Nacos components, Chapter 3 introduces the concept of ternary and the use of Nacos to implement the registration center and configuration center, including dynamic switching of the environment, dynamic refresh of the configuration, universal configuration, version rollback, etc. Core technology provides a basic architecture for the microservice environment; Chapter 4 introduces the Sentinel component responsible for current limiting and circuit breaker degradation, including collecting system operating status, flow control, circuit breaker degradation, hotspots, authorization, system rules, and flow control exceptions processing, circuit breaker exception handling, rule persistence, etc.; Chapter 4 introduces common cases of gateways and frequently used technical points commonly used in software projects, striving to provide programmers who develop microservice projects with a quick learning method.

JD.com link: https://item.jd.com/14010448.html

Guess you like

Origin blog.csdn.net/perfect2011/article/details/132713440