首页 > 解决方案 > Spring启动程序添加Elasticsearch后找不到主类

问题描述

我在 Spring 工具套件中作为 Spring Boot 应用程序运行。我在 pom.xml 中添加了 elasticsearch。然后,当我再次尝试将该程序作为 Spring Boot 应用程序运行时,它在下面抛出了以下错误。“错误:无法找到或加载主类 com.spring.elastic.SpringBootDataElasticsearchApplication”我使用 org.elasticsearch:elasticsearch:7.0.1

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>

谁能帮我解决这个问题?

标签: javaspring-bootelasticsearchspring-tool-suite

解决方案


推荐阅读