javanetbeans-platform

netbeans: bundle files to nbm


This Question refers to How to bundle additional (data) files with a Netbeans module?. I have two Pyhtonscripts, which I want to integrate in the created NBM, so they can be executed from within the plugin.

I tried all the solutions from the Question above (except the Maven part), as well as putting the files in every possible location inside the project, but it had no influence.

I think the last part of this tutorial -"Updating the Sources"- would do the trick. Am I on the right path? I did include the code in my build-init.xml, but (I don't know if I set the Locations right) there was no improvement at all.


Solution

  • You already posted the link to the right thread: 2nd answer is for maven, 3rd and accepted answer is for ant: just create a subdirectory called "release" in your module project. You can then get the File via InstalledFileLocator.getDefault().locate(...). To get "release/something.txt" you would call locate("something.txt", "your.module", false)