Community
Participate
Working Groups
Steps to reproduce: 1. Create a Web Application Bundle project with name "test". 2. Change the Web-ContextPath header in the MANIFEST.MF from "test" to "test-changed". 3. Go to <web-project> -> Properties -> Web Project Settings. The Context Root field still shows "test". This problem introduces inconsistency between the PDE and WTP models of the Web Application Bundle project, which causes problems in the behavior of the WTP Server Adapters. A possible solution is to synchronize the two model. If the PDE model changes, then the WTP model should update, and vice versa.
Created attachment 198828 [details] patch This patch provides two-way synchronization of the Web-context root between WTP and PDE model. It's applicable for Indigo and for Juno
Stefan, thank you for this patch. Unfortunately, I cannot apply it - known issue with Git patches. Please, follow the instructions on this wiki page how to contribute the patch correctly: http://wiki.eclipse.org/Development_Resources/Handling_Git_Contributions
Committed in Git-Hub: https://github.com/stefan-dimov/libra/commit/be1d7f7f4594e20bf6c687f98f2835d204365999
Stefan, thanks for the patch. Here is my experience with testing it: 1. If I change the context root in the Web Project Settings property page then a refactoring wizard pops up. After finishing it, the context root in the MANIFEST.MF is correctly change. 2. If I change the context root in MANIFEST.MF, then is also change in the WTP model. No refactoring wizard pops up. 3. If I change the context root in .settings/org.eclipse.wst.common.component (this is where the context root in the WTP model is persisted), then it is not changed in MANIFEST.MF. IMHO, we don't need the refactoring wizard. So, let's remove it from case 1. We also need case 3 working properly. I would be also happy to see some tests that cover the three use cases. Also I have some minor comments in the code: - there are lots of whitespace changes in the patch and makes it hard to read for seeing what is the actual change. Please, keep to the original code formatting and don't add unnecessary whitespaces. - the Activator class became too overloaded with code. Please, consider moving the new logic in a separate Java class and call it from the Activator.
The new commit: https://github.com/stefan-dimov/libra/commit/f82c5da247414e8c797ec77abd39048a9eecd680 > 1. If I change the context root in the Web Project Settings property page then > a refactoring wizard pops up. After finishing it, the context root in the > MANIFEST.MF is correctly change. - The refactoring wizard appearing is not introduced by this fix. >2. If I change the context root in MANIFEST.MF, then is also change in the WTP >model. No refactoring wizard pops up. - Still no change by this fix > 3. If I change the context root in .settings/org.eclipse.wst.common.component > (this is where the context root in the WTP model is persisted), then it is not > changed in MANIFEST.MF. - The new fix handles it > - there are lots of whitespace changes in the patch and makes it hard to read > for seeing what is the actual change. Please, keep to the original code > formatting and don't add unnecessary whitespaces. - I don't know how did it happen. I had to fix it in the new commit row by row manually > - the Activator class became too overloaded with code. Please, consider >moving the new logic in a separate Java class and call it from the Activator. - Handled in the new fix > I would be also happy to see some tests that cover the three use cases. - Still no tests. Will be implemented next week
Patch created: https://github.com/stefan-dimov/libra/commit/69d47626cc4929f7d850a40da3f1fb3a43c448ba
New version of the patch: https://github.com/stefan-dimov/libra/commit/86ae910f09248c5c5f0b11ba1c126fc65610661a
Additional test: https://github.com/stefan-dimov/libra/commit/02ec22ea8e845384030096b766cf2039937612dc
New test for check how change of manifest file affects the models: https://github.com/stefan-dimov/libra/commit/e8b3f8a89f77aba15d5b29a200da50cd7d822ba1
Change is pushed to the 'indigo' branch and merged to the 'master' branch: http://git.eclipse.org/c/libra/org.eclipse.libra.git/commit/?h=indigo&id=c887193cd644338142dc3c067070dbadb290bb7a I did lots of refactoring of the code and the tests. The fix can be tested from the snapshot p2 repo: http://download.eclipse.org/libra/maintenance/snapshot
Verified with http://download.eclipse.org/libra/maintenance/M-0.1.1-201107280918