【问题标题】:Spring Boot 2.1.0 Web app and Java 11 fail to maven clean installSpring Boot 2.1.0 Web 应用程序和 Java 11 无法进行 Maven 全新安装
【发布时间】:2018-11-12 19:52:30
【问题描述】:

以下 Web 应用无法 maven 全新安装:https://github.com/cassiusvm/sfg-pet-clinic

错误如下:

[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/cassius/git/sfg-pet-clinic/pet-clinic-web/src/main/java/guru/springframework/sfgpetclinic/controllers/PetController.java:[3,47] package guru.springframework.sfgpetclinic.model does not exist

以下网络应用程序不会失败 maven 全新安装:https://github.com/cassiusvm/spring5-recipe-app

在 Eclipse IDE 2018-09 上,两者都已成功构建并且运行良好。

两者都使用 Spring Boot 2.1.0 和 Java 11。

如何成功安装 sfg-pet-clinic 网络应用程序?

【问题讨论】:

  • 您确定使用maven-compiler-plugin:3.8.0 with <release>11</release> 吗?或者,如果您也可以共享带有错误详细信息的日志,那就更好了。我的意思是包guru.springframework.sfgpetclinic.model 存在于代码中。
  • 另外,是否有任何先前的配置可以成功编译此代码?我尝试克隆存储库并使用 Java8 执行,导致类似的编译失败。
  • 请粘贴您的 pom.xml/gradle.build,问题可以隐藏在那里。
  • 解决了。我确实将 repackage 包含在模块 pet-clinic-data 上的插件 spring-boot-maven-plugin 中。我确实将依赖项 mockito-core 包含在模块 pet-clinic-web 上的插件 wro4j-maven-plugin 中。

标签: maven spring-boot java-11


【解决方案1】:

解决了。

我确实将 id 重新打包到模块 pet-clinic-data 上的插件 spring-boot-maven-plugin 中。

我确实在模块 pet-clinic-web 上包含了对插件 wro4j-maven-plugin 的依赖 mockito-core。

【讨论】:

    【解决方案2】:

    我在同一个项目 pet-clinic-web 上,对我来说,将依赖项 mockito-core 添加到 wro4j-maven-plugin 就足够了。

    虽然项目在 jdk 8 上时我没有这个问题。当我更新到 jdk 11 时,问题就开始了。

    【讨论】:

      猜你喜欢
      • 2013-01-04
      • 2019-03-18
      • 2019-04-16
      • 2016-10-03
      • 1970-01-01
      • 2018-05-08
      • 2020-04-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多