Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-9454

Adding the JSF Facet (< 2.0) completely overwrites the project web.xml with m2e-wtp 0.13.x

    XMLWordPrintable

Details

    • Hide

      See JBIDE-6228.
      Only this time, not only the comments are removed, but the whole content is gone

      Show
      See JBIDE-6228 . Only this time, not only the comments are removed, but the whole content is gone

    Description

      This bug is an upstream issue (https://bugs.eclipse.org/bugs/show_bug.cgi?id=353834), I discovered it while investigating on JBIDE-6228.
      Since m2e-wtp 0.13.0, a typical maven-powered dynamic web project defines 2
      folders in its .component :
      1 - target/m2e/web-resources/ : contains generated files
      2 - src/main/webapp/ : contains user resources under SCM

      Both folders are deployed via the WTP server adapter. The target folder is put
      in first position because we sometimes need to override user resources (ex.
      dynamically replacing placeholders in configuration files) and WTP deploys the
      first resource it finds.

      When you add the JSF Facet to such project, and ask to add the faces servlet to
      the web.xml, the JSFFacetInstallDelegate pretty much does the following :

      • looks for the first folder found in .component (finds target/*)
      • finds no web.xml so generates an empty webxml model
      • serialize the new model to the web.xml it finds in src/main/webapp
        => the user web.xml is then totally overwritten.

      Easiest solution is to disable the Faces Servlet configuration for all JSF projects. That'd also fix JBIDE-6228.
      Twisted hack would be to change the configuration order in .component before and after changing adding the JSF Facet
      Time consuming solution would be to disable the Faces Servlet configuration during Facet install then, rewrite the web.xml update logic to add the missing Faces servlet config.

      Attachments

        Issue Links

          Activity

            People

              fbricon@redhat.com Fred Bricon
              fbricon@redhat.com Fred Bricon
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: