Hi there,
Is it possible to add entries to the manifest.mf file of jars generated by netbeans?
to build an osgi bundle for instance.
Hi there,
Is it possible to add entries to the manifest.mf file of jars generated by netbeans?
to build an osgi bundle for instance.
in the same dir as the build.xml you can put your manifest.mf file
I'm using Netbeans 6.7.1 Turns out that the build-imp.xml (the actual build script Netbeans uses)
So.. make sure you have the project-properties,run,main-Class filled with -anything-
i think that's some undocumented feature :(
this is my manifest content:
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build
Bundle-ManifestVersion: 2
Bundle-Name: jinstall
Bundle-SymbolicName: jinstall
Import-Package: ( .... )
Export-Package: ( .... )
Bundle-Activator: ( ..... )
See this article.
Here it is described how to
Why not using the a maven project, which worked well for me? E.g. apache felix
See this pluggable Swing example which I created in netbeans.
I have a Java Class Library project with a custom manifest file - perfect for an OSGI bundle. To get this working first edit project.properties and set:
manifest.file=manifest.mf
manifest.available=true
Create your own custom manifest.mf file in the project directory.
(At this point if you try a clean/build you still won't get your custom manifest file - NetBeans will provide its own. This is because the build-impl.xml Ant target "-do-jar-with-libraries-without-manifest" is being called immediately after "-do-jar-with-manifest", overwriting your custom manifest JAR file with a default NetBeans manifest JAR.)
Add a custom target to your build.xml file as follows:
<target name="-do-jar-with-libraries-without-manifest">
<!-- Inserted to prevent target from running so we can have a custom
manifest file with a class library project type. -->
</target>
Tested in NetBeans 6.7.1