使用 spring boot maven 插件构建 jar 时如何在 manifest.mf 中添加 Classpath 属性
How to add Classpath attribute in manifest.mf when using spring boot maven plugin to build jar
我正在使用 spring boot maven plugin.I 需要在 manifest.mf 文件中添加 class-path 属性 generated.This class-路径条目应包含 spring boot.How 创建的 fat jar 文件的 lib 文件夹中存在的所有 jar 文件这可能吗?
有简单的解决方法
只需要添加
maven-war-plugin
或
maven-jar-plugin
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
<manifestEntries>
<mode>development</mode>
<url>http://sample.com</url>
<key>value</key>
</manifestEntries>
</archive>
</configuration>
</plugin>
并将您的附加值放入 manifestEntries 中。
问候
亚历山大
我正在使用 spring boot maven plugin.I 需要在 manifest.mf 文件中添加 class-path 属性 generated.This class-路径条目应包含 spring boot.How 创建的 fat jar 文件的 lib 文件夹中存在的所有 jar 文件这可能吗?
有简单的解决方法
只需要添加
maven-war-plugin
或
maven-jar-plugin
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
<manifestEntries>
<mode>development</mode>
<url>http://sample.com</url>
<key>value</key>
</manifestEntries>
</archive>
</configuration>
</plugin>
并将您的附加值放入 manifestEntries 中。
问候 亚历山大