【问题标题】:Spring Boot jar - META-INF inside BOOT-INF folderSpring Boot jar - BOOT-INF 文件夹中的 META-INF
【发布时间】:2020-11-03 15:38:42
【问题描述】:

有没有办法在spring boot包装jar的BOOT-INF里面有META-INF文件夹? 这可能是一个微不足道的问题,但不知道该怎么做。下面是我现在打包的方式,它创建了三个文件夹BOOT_INF、META_INF、ORG。问这个的原因是因为可运行的 jar 无法找到 META-INF 中的文件夹。

<build>
    <finalName>XYZ</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>8</source>
                    <target>8</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <version>XYZ</version>
                <executions>
                    <execution>
                        <id>default-jar</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <excludes>
                                <exclude>XYZ</exclude>
                                <exclude>XYZ</exclude>
                            </excludes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <mainClass>XYZ</mainClass>
                    <addResources>true</addResources>
                    <wait>1000</wait>
                    <maxAttempts>250</maxAttempts>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>XYZ</version>
                <configuration>
                    <tarLongFileMode>XYZ</tarLongFileMode>
                    <tarLongFileMode>XYZ</tarLongFileMode>
                    <descriptors>
                        <descriptor>XYZ</descriptor>
                    </descriptors>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>XYZ</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

任何帮助我可以使用哪个插件来做到这一点?

【问题讨论】:

    标签: spring-boot jar packaging meta-inf runnable-jar


    【解决方案1】:

    在资源下添加 META-INF 文件夹后,我的类似问题得到解决。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-07-14
      • 1970-01-01
      • 1970-01-01
      • 2017-05-26
      • 2017-11-25
      • 2019-09-05
      • 1970-01-01
      • 2015-12-29
      相关资源
      最近更新 更多