Project: JDT
Bug 248899 [jar exporter] Jar export doesn't include files under META-INF
Reported: 2008-09-29 03:57:13 | Status: verified fixed

In Eclipse 3.4 (and since at least 3.1), if I create a text file in META-INF/services, and export a jar file, it will get included in the jar file as would be expected. In Eclipse 3.5 M2, this is broken. Whether or not I check the file it does not get included in the jar. Maybe there is some different combination of options that would do it, but at least it has changed since 3.4 and I was not able to figure out how to make it work in 3.5. I'm coding severity as "major" because putting files into META-INF/services is the way that the Java declarative services API works, so this makes it impossible to generate jar files that contain, for instance, annotation processors. To repro: 1. Create a new workspace and add a new Java project. 2. Add a java class, say, p.P 3. Add a folder META-INF/services, under the src folder. 4. In that folder, create a text file named javax.annotation.processing.Processor, with some text contents. 5. File -> Export -> Java -> Jar file 6. Walk through the wizard, making sure that the file in META-INF/services is selected (it will be by default). Save the jar file to a workspace folder named "export". Save the .jardesc in the project root. Finish. 7. Open the newly-created jar file. Note that it contains p.P, but does NOT contain the file in META-INF/services. 8. Also, right-click the .jardesc. Note that there is no "Open the jar description wizard" item, as there used to be. There's still a "create jar file" item, and clicking the .jardesc does open the wizard, but there used to be a separate menu item. The change was confusing, although I don't necessarily disagree with it.

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java