清单部分
该<manifestSections>元素提供了一种添加自定义清单部分的方法。它包含一个元素列表。<manifestSection>
注意:与此处的所有示例一样,此配置可用于所有使用 Maven Archiver 的插件,而不仅仅是本示例中的 maven-jar-plugin。
鉴于此配置:
<project>
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
...
<configuration>
<archive>
<manifestSections>
<manifestSection>
<name>foo</name>
<manifestEntries>
<id>nice foo</id>
</manifestEntries>
</manifestSection>
<manifestSection>
<name>bar</name>
<manifestEntries>
<id>nice bar</id>
</manifestEntries>
</manifestSection>
</manifestSections>
</archive>
</configuration>
...
</plugin>
</plugins>
</build>
...
</project>
以下内容将最终出现在清单中:
Manifest-Version: 1.0
Created-By: Apache Maven ${maven.version}
Build-Jdk: ${java.version}
Name: foo
id: nice foo
Name: bar
id: nice bar



