3月 092020
 

命令行mvn打包dubbo-admin时出现下面提示:

[INFO] Scanning for projects…

Downloading: http://repo1.maven.org/mavenDownloading: http://repo1.maven.org/mavenDownloading: http://repo1.maven.org/mavenDownloading: http://repo1.maven.org/mavenDownloading: http://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.1.4.RELEASE/spring-boot-starter-parent-2.1.4.RELEASE.pom

[ERROR] The build could not read 1 project -> [Help 1]

[ERROR]   

[ERROR]   The project org.apache:dubbo-admin:0.1 (/Users/jqzhu/Documents/codes/dubbo-admin/pom.xml) has 1 error

[ERROR]     Non-resolvable import POM: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.1.4.RELEASE from/to central (http://repo1.maven.org/maven2/): Failed to transfer file: http://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.1.4.RELEASE/spring-boot-starter-parent-2.1.4.RELEASE.pom. Return code is: 501 , ReasonPhrase:HTTPS Required. @ line 90, column 16 -> [Help 2]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR]

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException

[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

看来需要使用https代替http。

 

原因:

Effective January 15, 2020, The Central Repository no longer supports insecure communication over plain HTTP and requires that all requests to the repository are encrypted over HTTPS.

解决办法:

Replace http://repo1.maven.org/maven2/ with https://repo1.maven.org/maven2/

Replace http://repo.maven.apache.org/maven2/ with https://repo.maven.apache.org/maven2/

If for any reason your environment cannot support HTTPS, you have the option of using :  http://insecure.repo1.maven.org/maven2/

Sorry, the comment form is closed at this time.