【问题标题】:Spring Boot Dashboard won't show me App on VSCodeSpring Boot Dashboard 不会在 VSCode 上显示 App
【发布时间】: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


【解决方案1】:

你确定在 pom.xml 中有 maven build 插件吗

<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命令

【讨论】:

    【解决方案2】:

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

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

    我下载了您的项目并进行了尝试,但我无法重现该问题。它首先按预期停留在“导入项目”上,因为语言服务器正在下载依赖项。

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

    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.
    

    【讨论】:

      猜你喜欢
      • 2021-01-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-29
      • 1970-01-01
      • 2019-05-15
      • 1970-01-01
      相关资源
      最近更新 更多