Issues related to using the maven plugin in eclipse: Updating index central|http://repo1.maven.org/maven2

The problem of using the maven plugin in eclipse:Updating index central|http://repo1.maven.org/maven2

The problem is as follows:
because the unit uses filtering, when accessing the Internet, the content exceeding 10M will be rejected.
Because the maven plugin needs to download the Maven index file at the beginning, this file is relatively large, more than 38M, and the download is unsuccessful.
Therefore, when using Maven to add dependencies (Add Dependency), there is no prompt that the project is available, and in the Console, the output:
Unable to update index for central|http://repo1.maven.org/maven2 .

The solution is as follows:

 

1) Download the following two files by other means:
http://repo1.maven.org/maven2/.index/nexus-maven-repository-index.properties
http://repo2.maven.org.s3.amazonaws.com /.index/nexus-maven-repository-index.gz

 

2) Find an Apache Tomcat server and create a virtual directory of /maven2/.index in its root directory (Note: If you are using a windows system, you may not be able to create the .index folder, you must use the DOS command: mkdir .index ), copy the above two files to the directory pointed to by the virtual directory. 


3) Edit the c:\WINDOWS\system32\drivers\etc\hosts file and add: 
127.0.0.1 repo1.maven.org 
Note: 127.0.0.1 is the IP address of the Apache Tomcat server in step 2. 

 

 

4) In Eclipse, open the Maven Repositories panel on the Global Repositories --> central item, right-click, and then Rebuild Index.

 

5) Remove the content added in the hosts file before.

 

6) (Optional) Remove the Download repository index updates on starup option of the Maven item in Properties.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326644621&siteId=291194637