2

我想从我的发布 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)仍然存在。有什么见解吗?谢谢!

4

2 回答 2

2
<_removeheaders>Build-*</_removeheaders>

很高兴听到您发现插件很烦人(似乎没有寻找手册)。

于 2013-03-20T15:34:29.220 回答
0

我使用 maven-jar-plugin,这是我的 pom:

<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>
于 2013-03-20T14:55:12.890 回答