Vaadin eclipse plugin Vaadin facet can duplicate vaadin servlet in web.xml
|Reported by:||ringerc||Owned by:||ticketmaster|
|Component:||dontuse-Plug-in for Eclipse (Use github.com/vaadin/eclipse-plugin instead)||Version:||6.7.9|
If a Maven project that already contains a web.xml configured for Vaadin is imported into Eclipse with m2e, then the Vaadin facet is enabled in Project Facets, the Vaadin facet may mangle web.xml and introduce a duplicate copy of the Vaadin servlet.
This seems to happen if you click "Further configuration available..." for the Vaadin facet after enabling it. The assumption seems to be that if you click that option you want to *add* vaadin support to a project, not enable IDE support for Vaadin.
The UI needs to be reworked to make it clearer that you're asking Eclipse to modify the project. Furthermore, it needs some validation; if the application class already exists the dialog will be accepted without error then the "Apply..." phase will fail with:
Failed while installing Vaadin plugin for eclipse 1.0. Reason: Vaadin libraries installation failed [<<Detail] Vaadin libraries installation failed /project-name/src/main/java/com/example/project_name/Project_nameApplication.java already exists in target
What should happen is that the dialog should validate its parameters, showing an error beside the class name if it already exists and not accepting "[OK]" until the name is changed or "Create project template..." is unchecked.
The dialog should detect an existing Vaadin configuration in web.xml and uncheck "Create project template..." by default. If "Create project template" is checked and existing configuration is found, the dialog should ask whether the existing Vaadin parameters in web.xml should be removed and warn that a broken web.xml may be produced if they aren't.
"Create project template..." should be renamed to mean something. Maybe "Add Vaadin support to project..." ? It needs to be clear that it's actually modifying the project, not just the Eclipse configuration.
Alternately, "Create project template" should be renamed to "Create / modify Vaadin configuration in project" or something like that, and should be pre-filled with existing details from web.xml if found. If changed, a refactoring should be triggered. This is more work, of course.
The dialog is also notably missing a Cancel button, though escape works.
All in all, it needs some usability and design love.