Adding properties to manifest file with spring boot

筅森魡賤 提交于 2019-12-23 09:26:31

问题


I want to add SplashScreen-Image: <image name> to the manifest file.

How do I do this with Spring Boot's Maven Plugin? If this is not possible, how do I create a single executable jar using maven with additional properties?


回答1:


The answer was kinda obvious in hindsight. Spring-Boot's maven plugin rewrites the original manifest file so using the maven jar plugin the manifest can be written as normal. Like this:

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <configuration>
                <archive>
                    <manifestEntries>
                        <splashscreen-image>${image.name}</splashscreen-image>
                    </manifestEntries>
                </archive>
            </configuration>
        </plugin>

    </plugins>
</build>


来源:https://stackoverflow.com/questions/26865851/adding-properties-to-manifest-file-with-spring-boot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!