Recently i have been playing around with writing plugins which i then load using a ServiceLoader. In order for the ServiceLoader to find my Plugins, there has to be a text file included in my jar under META-INF/services/. The text file has to be named after the Interface the ServiceLoader is "looking for" and must include the canonical name of the implementing class(es). All of this is working absolutely fine, but there is one really annoying problem with this approach: each time the project is built, i have to manually add the /services/ folder as well the text file to the jar (using Winrar). This is extremely cumbersome during development, since i have to constantly re-built the project in order to test things, which means i also have to add the folder and the text file by hand every single time as well.
I really hope there is a way to have Java add the META-INF/services/ folder as well as the text file automatically when building the project, since this is driving me insane! :)
By the way, i am using Netbeans which (afaik) is using Ant internally to automate the build process. I guess this information could be relevant to my question.
Thanks!