Opened 5 years ago

Closed 2 years ago

#8901 closed defect (needmoreinfo)

Vaadin eclipse plugin Vaadin facet can duplicate vaadin servlet in web.xml

Reported by: ringerc Owned by: ticketmaster
Priority: normal Milestone:
Component: dontuse-Plug-in for Eclipse (Use github.com/vaadin/eclipse-plugin instead) Version: 6.7.9
Keywords: cleaning Cc:
Depends on:
Workaround:
Verified: no
Fv: no

Description

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.

Attachments (1)

web.xml (1.9 KB) - added by ringerc 5 years ago.
Broken web.xml created by Vaadin plugin

Download all attachments as: .zip

Change history (6)

Changed 5 years ago by ringerc

Broken web.xml created by Vaadin plugin

comment:1 Changed 5 years ago by ringerc

The attached web.xml was created by:

  • Creating a vaadin archetype project with Maven
  • importing it into eclipse
  • in project facets, enabling the vaadin facet
  • clicking "Further configuration available..."
  • Clicking OK

That's not how the default behavour should be.

comment:2 Changed 5 years ago by ringerc

  • Priority changed from undefined to normal

comment:3 Changed 3 years ago by Artur Signell

  • Verified unset

comment:4 Changed 3 years ago by Artur Signell

  • Fv unset

comment:5 Changed 2 years ago by Artur Signell

  • Keywords cleaning added
  • Resolution set to needmoreinfo
  • Status changed from new to closed

A lot of tickets have been left hanging in the issue tracker through the years. Some of them are still relevant, some of them have been fixed a long time ago and some are no longer valid. To get a better look on what is important and still relevant, we are closing old tickets which have not been touched in a long time.

No further work will be done on this ticket unless someone indicates that it's still relevant.

If this ticket is still relevant to you, please reopen it.

Note: See TracTickets for help on using tickets.