【发布时间】:2020-12-29 02:53:07
【问题描述】:
我正在尝试在 Visual Studio 代码中启动一个 maven 项目,我运行 mvn clean install 命令来生成战争并且一切正常,但是在 spring-boot 仪表板选项卡中,应用程序似乎无法启动它。
这是我的 maven 和 java 版本:
PS C:\Projects\PortalTimbrado> mvn -v
Apache Maven 3.6.2 (40f52333136460af0dc0d7232c0dc0bcf0d9e117; 2019-08-27T10:06:16-05:00)
Maven home: C:\Maven\bin\..
Java version: 1.8.0_251, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_251\jre
Default locale: es_MX, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
我已经尝试使用命令 mvn spring-boot:run 但失败了,这是输出:
[INFO] Scanning for projects...
Downloading from redhat-ga: https://maven.repository.redhat.com/ga/org/apache/maven/plugins/maven-metadata.xml
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml
Downloading from redhat-ga: https://maven.repository.redhat.com/ga/org/codehaus/mojo/maven-metadata.xml
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Downloaded from redhat-ga: https://maven.repository.redhat.com/ga/org/apache/maven/plugins/maven-metadata.xml (2.5 kB at 1.9 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml (14 kB at 9.5 kB/s)
Downloaded from redhat-ga: https://maven.repository.redhat.com/ga/org/codehaus/mojo/maven-metadata.xml (537 B at 368 B/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml (20 kB at 14 kB/s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.524 s
[INFO] Finished at: 2020-09-10T10:41:04-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'spring-boot' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\dlopezd\.m2\repository), redhat-ga (https://maven.repository.redhat.com/ga/), central (https://repo.maven.apache.org/maven2)] -> [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/NoPluginFoundForPrefixException```
Please help me!
【问题讨论】:
-
您遇到的错误是什么?
-
如错误输出中所述,您的项目中是否有
No plugin found for prefix 'spring-boot' in the c? -
查看@ToànNguyễnHải 的答案。如果这没有帮助,请分享您的 pom.xml 文件。
标签: java spring spring-boot maven visual-studio-code