spring-boot - Spring Boot 'bootJar' 任务不构建胖 jar,而是排除 .original
问题描述
bubbleshadow% ls -l build/libs
total 83544
-rw-r--r-- 1 dlynch staff 42772394 May 14 08:37 bubbleshadow-0.0.1-SNAPSHOT.jar
运行上面的 .jar 文件(应该是一个胖 jar)时,我收到以下错误:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path res
ource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
我试图按照以下说明进行操作: https ://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/html/
在 8.1 中,它对 Java 插件说反应(原文如此):
接着:
创建一个名为 bootJar 的 BootJar 任务,该任务将为项目创建一个可执行(原文如此)的 fat jar。
我的构建在 IntelliJ IDEA 中运行,但在命令行上执行时不运行。
根据 Josh Long 的 Book Learning Spring Boot 2.0 - Second Edition,看到它说:
If we peek at the output, we'll find the original JAR file (non-FAT) along with the rebundled one containing our application code as well as the third-party dependencies, as shown here: $ ls build/libs
learning-spring-boot-0.0.1-SNAPSHOT.jar
learning-spring-boot-0.0.1-SNAPSHOT.jar.original
Turnquist, Greg L.. 学习 Spring Boot 2.0 - 第二版:简化基于微服务和响应式编程的闪电般快速应用程序的开发(Kindle Locations 664-667 ( sic ))。包出版。Kindle版。
我不明白为什么没有生产 .original jar 并且它为我生产的 jar 无法运行。
解决方案
推荐阅读
- reactjs - 如何解决未渲染的对象列表
- vb.net - VB.NET - 使用 aes 密钥文件从文件中解密已经加密的密码
- angular - 对 Azure Blob 存储帐户中托管的 Angular 应用程序的 URLRewrite 支持
- css - 为什么固定到顶部的导航栏(位置:固定)需要宽度属性?
- windows - 使用连字符名称批量重命名多个文件
- bash - 如何读取 shell 脚本中的两行(在单次迭代中第 1 行、第 2 行 - 下一次迭代应该采用第 2 行、第 3 行……依此类推)
- deep-learning - 训练 MTCNN 进行人脸检测
- arrays - 从 Google 表格中的单个范围拆分多个范围
- spring-boot - 如何设计在springboot中接受JSON数组作为输入的post api?
- heroku - Heroku烧瓶webapp部署中的requirements.txt vs Pipfile?