How can one prevent certain attributes from being added to the bundle's manifest with the Maven Bundle Plugin?

StackOverflow https://stackoverflow.com/questions/15526623

문제

I would like to remove certain headers from my release jars (e.g. "Built-by").

I have read that setting the headers to an empty content should do the trick, but it's not working for me. For example, I'm using:

<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>

While Something-else is being added, all the other headers (e.g. Built-By) remain. Any insights? Thanks!

도움이 되었습니까?

해결책

<_removeheaders>Build-*</_removeheaders>

Nice to hear you find the plugin annoying (without seeming to have looked for the manual).

다른 팁

I use maven-jar-plugin and thi is my pice of 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>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top