Spring Boot Maven插件-没有BOOT-INF目录 [英] Spring Boot Maven Plugin - No BOOT-INF directory

查看:1425
本文介绍了Spring Boot Maven插件-没有BOOT-INF目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

spring-boot-maven-plugin的版本1.3.8.RELEASE和版本1.4.0.RELEASE之间-生成的包结构发生了变化(如果解压缩了uber jar文件) 1.3.8.RELEASE com,lib,META-INF和org目录 1.4.0.RELEASE具有BOOT-INF,META-INF和org目录 基本上从1.4.0.RELEASE开始-所有类和库都在BOOT-INF目录中. 因此,当您尝试在Amazon Lambda上运行Spring Boot项目时,它表示找不到一个jar,因为它无法读取新的Spring Boot Uber jar结构

Between version 1.3.8.RELEASE of the spring-boot-maven-plugin and version 1.4.0.RELEASE - there has been a change in the generated package structure (if you extract the uber jar file) 1.3.8.RELEASE com, lib, META-INF and org directories 1.4.0.RELEASE has a BOOT-INF, META-INF and org directories Basically from 1.4.0.RELEASE onwards - all the classes and libs are in the BOOT-INF directory. Due to this - when you try to run a Spring Boot project on Amazon Lambda - it says that there is a jar not found as it cannot read the new Spring Boot Uber jar structure

我的问题是-能否在较新版本的Spring Boot Maven插件中获取它以生成与1.3.9.RELEASE版本相同的结构的uber jar?

My question is - is it possible in the newer versions of the Spring Boot Maven Plugin to get it to generate the uber jar to be the same structure as in version 1.3.9.RELEASE?

我尝试了maven-shade-plugin-但这导致了其他问题

I tried the maven-shade-plugin - but that leads to other issues

非常感谢您的帮助

谢谢 达米安(Damien)

Thanks Damien

推荐答案

解决方案是在pom.xml文件中为插件添加MODULE布局

The solution was to add the MODULE layout for the plugin in the pom.xml file

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <layout>MODULE</layout>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>repackage</goal>
            </goals>
        </execution>
    </executions>
</plugin>

这篇关于Spring Boot Maven插件-没有BOOT-INF目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆