Community
Participate
Working Groups
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.
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
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"/>
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.
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.
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.
Thank you Rob and Neeraj, I think Gilbert should be good for now.
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)
Closing as part of mass query to clean up old resolved bugs in untargetted milestones.