2

リリースjarから特定のヘッダーを削除したい(例:「Built-by」)。

ヘッダーを空のコンテンツに設定するとうまくいくはずだと読みましたが、うまくいきません。たとえば、私は以下を使用しています:

<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 に答える