我想从我的发布jar中删除某些头(例如:"由")。
我读到设置标题为空内容应该做的技巧,但它不适合我。例如,我使用:
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Built-By>a</Built-By>
<Build-Jdk></Build-Jdk>
<Created-By></Created-By>
<Somethng-else>Hello</Somethng-else>
</instructions>
</configuration>
</plugin>
当添加Something-else
时,所有其他标头(例如Built-By
)保留。见解吗?谢谢!
<_removeheaders>Build-*</_removeheaders>
很高兴听到你觉得这个插件很烦人(似乎没有找过手册)
我使用maven-jar-plugin,这是我的一段代码:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>...MyClass</mainClass>
<classpathPrefix>libs/</classpathPrefix>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Built-By>a</Built-By>
<Build-Jdk></Build-Jdk>
<Created-By></Created-By>
<Somethng-else>Hello</Somethng-else>
</manifestEntries>
</archive>
</configuration>
</plugin>