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

Question

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!

Was it helpful?

Solution

<_removeheaders>Build-*</_removeheaders>

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

OTHER TIPS

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>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top