Community
Participate
Working Groups
Steps to reproduce: 1. Create an EAR 5 project. 2. Create an EJB 3.0 project. 2.1. Check the "Add project to EAR". 2.2. Choose the EAR 5 project in "EAR Project Name". 2.3. The wizard creates an EJB client project together with the EJB project. 3. Create a Session Bean in the EJB 3.0 project. 3.1. Leave wizard setting as by default. 3.2. The wizard will generate the bean class in the EJB project and the local business interface in the EJB client project. 4. Export the EAR 5 project. 4.1. Leave "Export source files" unchecked. In the exported EAR there are two jars - one for the EJB project and another one for the EJB client project. The jar for the EJB project contains only the compiled class files - as expected. The jar for the EJB client project contains also the sources files of the exported classes - not expected. The value of the "Export source files" checkbox should also determine whether to export the sources in the included EJB client projects. This problem is not reproduced with EAR 1.4 projects.
The problem is the Client jar is fully indexed before the export source flag is set.
This happens not only for EJB Client project, but for every Utility project referenced by the EAR.
Created attachment 112071 [details] patch The root of the problem is that the "export source" flag is set too late for Utility project - after determining which file to be included in the exported archive. This patch explicitly sets the "export source" flag before calling the JavaEEQuickPeek.
Carl, please review this patch for 3.0.2 and promote for PMC approval.
Approved.
Unless this bug is fixed, the source files for classes within a utility jar will be automatically included in the utility jar within the EAR. This can cause IP problems for users. There is no workaround. I ran the Java EE JUnit bucket against this, and tested this by hand. Jason Sholl and I have reviewed this fix. This is a low risk fix.
Committed and released to HEAD and R3_0_maintenance.
Verified with the M-3.0.2-20080911111734 build.