Support adding web and WEB-INF resources with relative path of source
---------------------------------------------------------------------
Key: SHRINKWRAP-318
URL:
https://issues.jboss.org/browse/SHRINKWRAP-318
Project: ShrinkWrap
Issue Type: Enhancement
Components: api
Affects Versions: 1.0.0-beta-5
Reporter: Ian Brandt
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
{{addAsWebInfResource("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 {{addAs{_}X{_}(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.
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira