Spring Boot 仪表板不会在 VSCode 上显示应用程序

问题描述 投票:0回答:3

我正在尝试在 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!
java spring spring-boot maven visual-studio-code
3个回答
1
投票

你确定pom.xml中有maven构建插件吗

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>

    </plugins>
</build>

还要检查 pom.xml 中的父级

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.3.3.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

然后重试mvn spring-boot:run命令


1
投票

来源:https://github.com/Microsoft/vscode-spring-boot-dashboard/issues/44

Eskibear于2018年10月15日发表评论

我下载了你的项目并进行了尝试,但我无法重现该问题。它首先按预期停留在“导入项目”上,因为语言服务器正在下载依赖项。然后<1 min, the project "demo" appeared in the explorer.

之后

您可以尝试以下步骤,但我不确定是否可以帮助您。

Close all your VSCode windows.
Open ~/.vscode/extensions folder, and remove folders with prefix like "redhat.java", "vscjava.vscode-spring-boot-dashboard", "vscjava.vscode-java-debug", "pivotal.vscode-spring-boot".
Open VSCode, install the spring boot dashboard extension from the marketplace.
Now try opening the project again, see if it works.

0
投票

错误运行命令 spring-boot-dashboard.refresh:找不到命令“spring-boot-dashboard.refresh”。这可能是由贡献 spring-boot-dashboard.refresh 的扩展引起的。

© www.soinside.com 2019 - 2024. All rights reserved.