执行mvn clean install出现[INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building springboot-schema 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ Downloading: http://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-maven-plugin/2.2.2.RELEASE/spring-boot-maven-plugin-2.2.2.RELEASE.pom [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 7.419 s [INFO] Finished at: 2023-07-22T19:52:51+08:00 [INFO] Final Memory: 9M/245M [INFO] ------------------------------------------------------------------------ [ERROR] Plugin org.springframework.boot:spring-boot-maven-plugin:2.2.2.RELEASE or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.springframew ork.boot:spring-boot-maven-plugin:jar:2.2.2.RELEASE: Could not transfer artifact org.springframework.boot:spring-boot-maven-plugin:pom:2.2.2.RELEASE from/to central (http://repo.maven. apache.org/maven2): Failed to transfer file: http://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-maven-plugin/2.2.2.RELEASE/spring-boot-maven-plugin-2.2.2.RELEASE. pom. Return code is: 501 , ReasonPhrase:HTTPS Required. -> [Help 1] [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/PluginResolutionException PS C:\Users\16283\Desktop\springbootc8hzm>
时间: 2023-08-15 10:10:25 浏览: 312
ojdbc7-12.2.0.1.jar
根据你提供的日志信息,出现了无法解析插件的错误。错误信息中显示了以下内容:
```
[ERROR] Plugin org.springframework.boot:spring-boot-maven-plugin:2.2.2.RELEASE or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.springframew
ork.boot:spring-boot-maven-plugin:jar:2.2.2.RELEASE: Could not transfer artifact org.springframework.boot:spring-boot-maven-plugin:pom:2.2.2.RELEASE from/to central (http://repo.maven.
apache.org/maven2): Failed to transfer file: http://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-maven-plugin/2.2.2.RELEASE/spring-boot-maven-plugin-2.2.2.RELEASE.
pom. Return code is: 501 , ReasonPhrase:HTTPS Required. -> [Help 1]
```
从错误信息中可以看出,Maven 无法从远程仓库下载插件的 POM 文件。错误的原因是 Maven 需要使用 HTTPS 协议进行下载,而不是使用 HTTP 协议。
解决这个问题的方法是在 Maven 的配置文件(settings.xml)中添加镜像源,并确保使用的是支持 HTTPS 的镜像源。
你可以尝试按照以下步骤解决问题:
1. 找到 Maven 的配置文件 `settings.xml`。该文件通常位于 Maven 的安装目录下的 `conf` 文件夹中。
2. 打开 `settings.xml` 文件,并在 `<mirrors>` 标签内添加以下内容:
```xml
<mirror>
<id>central-https</id>
<url>https://repo.maven.apache.org/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
```
3. 保存文件并重新运行 `mvn clean install` 命令。
这样应该可以解决问题。如果还有其他疑问,请随时告诉我。
阅读全文