【问题标题】:Java spring boot jar file error when running maven package commandjava spring boot jar文件在运行maven package命令时出错
【发布时间】:2023-03-30 00:20:01
【问题描述】:

当我尝试在我的 Spring Boot 应用程序上运行 maven 包以创建 jar 文件时,我收到此错误:

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file

这些是我的 pom.xml 文件的依赖项


    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

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

【问题讨论】:

    标签: java spring spring-boot maven


    【解决方案1】:

    您可能有版本问题,请参考此 [BeanDefinitionStoreException Failed to read candidate component class] 并让我知道您的框架及其版本

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-12-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-20
      • 1970-01-01
      • 2018-04-14
      • 2021-11-28
      • 2016-11-07
      相关资源
      最近更新 更多