【问题标题】:Getting errors packaging a working Spring Tool Suit app打包工作的 Spring Tool Suite 应用程序时出错
【发布时间】:2021-04-18 07:36:48
【问题描述】:

我在 Spring Tools Suite 上编写了一个 Spring Boot 应用程序,该应用程序在 STS 上运行良好。这是 Spring In Action Fifth Edition 中的一个示例(顺便说一下,本书的代码有很多错误)。但是当我试图将它打包到一个 jar 文件中时,Maven 突然开始抛出编译错误。基本上消息是:

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project taco-cloud: Compilation failure: Compilation failure: 

[ERROR] /Users/lm2a/mmxx/sts-workspace/taco-cloud/src/main/java/tacos/data/JdbcTacoRepository.java:[18,8] tacos.data.JdbcTacoRepository is not abstract and does not override abstract method deleteAll() in org.springframework.data.repository.CrudRepository

[ERROR] /Users/lm2a/mmxx/sts-workspace/taco-cloud/src/main/java/tacos/data/JdbcIngredientRepository.java:[14,8] tacos.data.JdbcIngredientRepository is not abstract and does not override abstract method deleteAll() in org.springframework.data.repository.CrudRepository

[ERROR] /Users/lm2a/mmxx/sts-workspace/taco-cloud/src/main/java/tacos/data/JdbcIngredientRepository.java:[31,3] method does not override or implement a method from a supertype

[ERROR] /Users/lm2a/mmxx/sts-workspace/taco-cloud/src/main/java/tacos/data/JdbcOrderRepository.java:[19,8] tacos.data.JdbcOrderRepository is not abstract and does not override abstract method deleteAll() in org.springframework.data.repository.CrudRepository

它应该在 Spring Data JPA 上我们可以使用一个我们不需要实现的接口(CrudRepository),它将为我们提供很多 CRUD 方法。这个事实以及它在 STS 上运行顺利的事实(并且没有抱怨任何未实现的方法)让我感到迷茫。 任何帮助将不胜感激。

【问题讨论】:

    标签: spring-boot maven sts crud-repository


    【解决方案1】:

    请忘记这个问题。这只是我的错误,一些 JDBC 实现(第 3 章中的早期示例)仍然存在于我的 JPA 项目中,并且这些类正在实现一些 CRUD 方法,这似乎是错误的根源。向我道歉。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-01-21
      • 2012-09-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-18
      • 1970-01-01
      • 2015-03-21
      相关资源
      最近更新 更多