This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 220912 - Export of EAR 5 includes the sources of Utility projects
Summary: Export of EAR 5 includes the sources of Utility projects
Status: CLOSED FIXED
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 3.0.2   Edit
Assignee: Kaloyan Raev CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard: PMC_approved
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-29 05:49 EST by Kaloyan Raev CLA
Modified: 2008-09-11 15:12 EDT (History)
4 users (show)

See Also:
ccc: pmc_approved? (david_williams)
ccc: pmc_approved? (raghunathan.srinivasan)
ccc: pmc_approved? (naci.dai)
deboer: pmc_approved+
ccc: pmc_approved? (neil.hauge)
ccc: pmc_approved? (kaloyan)
ccc: review+
jsholl: review+


Attachments
patch (2.16 KB, patch)
2008-09-09 08:01 EDT, Kaloyan Raev CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kaloyan Raev CLA 2008-02-29 05:49:18 EST
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.
Comment 1 Jason Sholl CLA 2008-03-03 11:16:17 EST
The problem is the Client jar is fully indexed before the export source flag is set.
Comment 2 Kaloyan Raev CLA 2008-09-09 05:23:27 EDT
This happens not only for EJB Client project, but for every Utility project referenced by the EAR. 
Comment 3 Kaloyan Raev CLA 2008-09-09 08:01:55 EDT
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.
Comment 4 Kaloyan Raev CLA 2008-09-09 08:02:42 EDT
Carl, please review this patch for 3.0.2 and promote for PMC approval. 
Comment 5 Carl Anderson CLA 2008-09-10 02:04:31 EDT
Approved.
Comment 6 Carl Anderson CLA 2008-09-10 02:14:51 EDT
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.
Comment 7 Tim deBoer CLA 2008-09-10 09:04:10 EDT
Approved.
Comment 8 Kaloyan Raev CLA 2008-09-10 09:22:30 EDT
Committed and released to HEAD and R3_0_maintenance. 
Comment 9 Kaloyan Raev CLA 2008-09-11 15:12:20 EDT
Verified with the M-3.0.2-20080911111734 build.