zoukankan      html  css  js  c++  java
  • Spring Boot 自定义Starter 可能引发的问题(Error)

    如果你的项目出现:

    Consider defining a bean of type 'com.wy.helloworld_spring_boot_starter.PersonService' in your configuration.

    表示无法找到你所创建的类

    问题原因: 你创建的项目非maven自定义项目,一定使用了spring initialize 创建,导入了spring boot 的父项目,

    后期引入Starter 时,出现无法导入是那个类的问题,

    你必须定义域一个Maven项目,并使用下面的配置

    <properties>
                <commonversion>2.2.5.RELEASE</commonversion>
        </properties>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter</artifactId>
                <version>${commonversion}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-autoconfigure</artifactId>
                <version>${commonversion}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-configuration-processor</artifactId>
                <version>${commonversion}</version>
                <optional>true</optional>
            </dependency>
        </dependencies>
  • 相关阅读:
    记一次MD5妙用
    go执行外部应用
    Go语言中的HTTP
    Go语言中的UDP应用
    Go学习
    Element-ui学习使用
    Vue学习
    BootCDNApi使用记录
    jquery.easypiechart.js简介
    jquery.gritter.js简介
  • 原文地址:https://www.cnblogs.com/dgwblog/p/12397346.html
Copyright © 2011-2022 走看看