Uploaded image for project: 'ShrinkWrap'
  1. ShrinkWrap
  2. SHRINKWRAP-318

Support adding web and WEB-INF resources with relative path of source

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.0.0-beta-5
    • api
    • None

      I've noticed with WebArchives that addAsResource(String) preserves the relative path of the source. E.g. addAsResource("some/file") is added to the archive as "WEB-INF/classes/some/file". On the other hand addAsWebResource(String) and addAsWebInfResource(String) do not preserve the relative source path.

      I have the webapp resources for my app under test copied to the test classpath relative from the web root. Any time I have a WEB-INF resource under one or more subfolders I find that I have to do addAsWebInfResource("WEB-INF/jsp/path/to/some.jsp", "jsp/path/to/some.jsp") or addAsWebResource("WEB-INF/jsp/path/to/some.jsp", "WEB-INF/jsp/path/to/some.jsp"). It would be preferable to just be able to say addAsWebResource("WEB-INF/jsp/path/to/some.jsp"), but when I do that the JSP is added to the archive as "some.jsp" at the web root.

      I believe the API would be more intuitive if the addAsX(String[, ...]) methods were consistent with regards to preserving the relative path of the source resource. It would also be useful to have the option of preserving the source resource's path, or not. Perhaps addAsResource(String) and addAsRelativeResource(String), etc.? Note however that I haven't considered the other add overloads (Asset, File, etc.) as I haven't used them yet.

            Unassigned Unassigned
            ianbrandt Ian Brandt (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: