Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 339957

Summary: Files generated by annotations are not included when using the 'bundle.jar' action.
Product: z_Archived Reporter: Antony Riley <antony>
Component: BuckminsterAssignee: buckminster.core-inbox <buckminster.core-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: thomas
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Zip containing annotation source project + org.demo.demosite project referened in the original bug report. none

Description Antony Riley CLA 2011-03-14 19:22:41 EDT
Build Identifier: 20110218-0911

Annotations can generate files when they are processed by the compiler, however when they are executed via buckminster either these files are not generated or they are not included in the resulting jar file.

When a plugin project is exported as "Plugin Development/Deployable Plugins and Fragments", the file(s) generated by the annotation(s) are included in the resulting jar file, these generated files are also included when manually building a legacy site.

When a plugin project is exported using buckminster 'site.p2' or 'bundle.jar' these files are not included in the resulting jar file(s). It is not clear if the annotation is being executed at all.

Reproducible: Always

Steps to Reproduce:
1. Import the attached org.demo.demoplugin project.
2. Right click, buckminster->invoke action.
3. Select bundle.jar and a properties file specifying an output location.
4. Inspect the generated jar file, it should contain a file: META-INF/services/java.lang.String

For comparison export as 'Depoyable Plugins and Fragments'.
Comment 1 Antony Riley CLA 2011-03-14 19:24:44 EDT
Created attachment 191175 [details]
Zip containing annotation source project + org.demo.demosite project referened in the original bug report.
Comment 2 Thomas Hallgren CLA 2011-03-15 01:56:11 EDT
Buckminster performs a normal workspace build. That build doesn't produce the META-INF/services folder. My guess would be that this is because the tooling doesn't have the annotation bundle on its classpath.

When you build using pde export, it will first create an ant-script. From that ant-script, it will call the Java compiler. That is a different compiler instance, i.e. it's not the same compiler as is used in the workspace. Consequently, it can be fed with classpath entries from other stuff that the workspace compiler has created.

I bet that if you install the annotationprocessor into your IDE (and hence into Bucky), the services folder will appear right there, in your workspace and it will be maintained while you work with your classpaths.
Comment 3 Thomas Hallgren CLA 2011-03-15 03:02:23 EDT
This bug turns out to be a duplicate.

*** This bug has been marked as a duplicate of bug 280542 ***
Comment 4 Thomas Hallgren CLA 2011-03-15 03:12:43 EDT
and that duplicate also points to the solution:

http://code.google.com/p/spi/wiki/EclipseSettings

Once you've configured the project specific settings according to that wiki page, the correct entry is generated under the output folder (i.e. bin/META-INF) and also included in the jar built by bundle.jar.