繁体   English   中英

ComponentScan 或 EntityScan 在另一个项目中找不到实体

[英]ComponentScan or EntityScan don't find entities in another project

我有 spring 引导项目,我在其中从其他 spring 引导项目导入实体。

一个有实体的项目的依赖如下

    <dependency>
        <groupId>models</groupId>
        <artifactId>models</artifactId>
        <version>0.2</version>
    </dependency>

主工程配置如下

@SpringBootApplication
@EnableDiscoveryClient
@EnableZuulProxy
@ComponentScan(basePackages = "model.entity")
public class SecurityService {
    public static void main(String[] args) {
        run(SecurityService.class, args);
    }
}

我试过使用@ComponentScan 和@EntityScan。 我试图从 .m2 目录中删除这些项目,但我总是得到相同的错误(附加为 screeshoot) stacktrace

这是我的错误,我忘了添加

<dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
    </dependency>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM