0

I am looking at using OSGI and I use the Netbeans platform to create the Java code. I need to make some additions to the Manifest.mf file which I understand is automatically created by Netbeans when the particular project is built. Also I am using Maven as the build system

I would however like to include some specific OSGI entries but I am not sure how this can be done in Netbeans. Do I need to manually alter pom.xml or is it done 'GUI-fashion' through the project properties dialogue?

D-Dᴙum
  • 7,689
  • 8
  • 58
  • 97

2 Answers2

1

I assume you are using the Maven Bundle Plugin since that is the most common way of developing OSGi bundles with Maven; I'll also ignore anything to do with Netbeans because it's not relevant.

You can create arbibrary entries in the generated manifest by adding them in XML format to the POM under the plugin/configuration/instructions section. For example to add a header called My-Header with value foo I would do this:

<plugin>
    ...
    <configuration>
        <instructions>
            ...
            <My-Header>foo</My-Header>
            ...
        </instructions>
    </configuration>
</plugin>
Neil Bartlett
  • 23,743
  • 4
  • 44
  • 77
  • Hi Neil, and thanks for your answer. I just wondered if Netbeans provided a 'GUI-way' of adding entries rather than manually editing the POM. I'm not an expert at the Maven build system though I should look into it more. – D-Dᴙum Aug 02 '14 at 11:29
0

No, NetBeans doesn't mostly provide UI for maven plugin configuration (with some small exceptions like JDK source/target level) but it will try to understand any Maven configuration if it's relevant to operation of the IDE or it's plugins. So configuring your (Maven) build to work as per previous answer is the way to go.

mkleint
  • 2,281
  • 1
  • 14
  • 17