Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 125705 - Automatically change associated artifacts when .component file is modified
Summary: Automatically change associated artifacts when .component file is modified
Status: CLOSED WONTFIX
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: 1.0.1   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Rob Frost CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 117930
  Show dependency tree
 
Reported: 2006-01-30 10:36 EST by Gilbert Andrews CLA
Modified: 2007-04-03 11:45 EDT (History)
2 users (show)

See Also:


Attachments
this is the java project that had facets added programatically (24.75 KB, application/x-zip-compressed)
2006-01-30 11:34 EST, Gilbert Andrews CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gilbert Andrews CLA 2006-01-30 10:36:20 EST
In General there are a couple problems in the connection between the J2EE module dependencies ui and the .component file. 

To create the problem create a java project and a web project. Now go to the Web project .components file and add the following:

<dependent-module deploy-path="/WEB-INF/lib" handle="module:/resource/JavaProject/JavaProject">
            <dependency-type>uses</dependency-type>
        </dependent-module> 

save the file.

Now open the web project properties window and proceed to the J2EE module dependencies section. The Java Project is not checked and is therefore not correct. 

Another problem i noticed is that you can add a javaproject from this ui but when you uncheck it the project does not get removed.
Comment 1 Gilbert Andrews CLA 2006-01-30 11:34:15 EST
Created attachment 33793 [details]
this is the java project that had facets added programatically

Please use this java project as it had facets that were created programatically
Comment 2 Neeraj Agrawal CLA 2006-01-30 12:22:51 EST
You have to write code to create an entry in the .classpath of the Web project,

the entry would  look like 
<classpathentry exported="true" kind="src" path="/webtestJava2Client"/>
Comment 3 John Lanuti CLA 2006-01-30 12:59:24 EST
The problem is the edit to the .component file is not updating the projects .classpath to add an entry for that project reference.  I'm not sure if we've ever claimed to add this during a manual edit such as this... If you add the project dependency to fix the .classpath, then the project will show on the web library page.

Rob, can you take a look?  I'm not sure this would be an 1.0.1 issue or not since going through the UI does work to add the module dependency.

The second part, about the removal not applying, defect 125722 is already opened to track this problem.
Comment 4 Neeraj Agrawal CLA 2006-01-30 13:41:55 EST
The  real issue here was to create a  dependent project for a web project, as per my discussion with Gilbert, he agrees that copying the dependent module is not the real issue  here.

As suggested by me, in his code if he creates a classpathentry for the java project he will get the dessired functionality.
Comment 5 Rob Frost CLA 2006-01-30 14:02:54 EST
My understanding is that WTP does not currently support automatic artifact updates of this type; the user needs to make such modifications via the UI (and those changes will trigger appropriate updates; project deletes and renames also automatically update associated artifacts). Direct manipulation of the .component file will not trigger the addition of a .classpath entry (if you need to do these things programmatically, the best route is to execute the operations executed by the J2EE Module Dependencies UI).

I'm therefore changing name of this bug, making it an enhancement and unsetting the target milestone.

Please let me know if these does not match folks understanding.
Comment 6 John Lanuti CLA 2006-01-30 15:05:32 EST
Thank you Rob and Neeraj, I think Gilbert should be good for now.
Comment 7 Rob Frost CLA 2006-11-29 14:37:43 EST
Resolving this one as "won't fix" - one can modify the module dependencies either via the UI or via execution of the underlying operations (CreateReferenceComponentsDataModelProvider for a WEB-INF/lib dependency or UpdateManifestDataModelProperties for a inter-module dependency)
Comment 8 John Lanuti CLA 2007-04-03 11:45:10 EDT
Closing as part of mass query to clean up old resolved bugs in untargetted milestones.