[
https://jira.jboss.org/browse/SHRINKWRAP-163?page=com.atlassian.jira.plug...
]
Ken Gullaksen commented on SHRINKWRAP-163:
------------------------------------------
Great :)
Just want to restate Dan Allens question for clarification:
{quote}
The specified archive type (e.g., WebArchive) isn't created until after the internal
archive (MemoryMapArchiveImpl), using Assignable#as(Class<T>). This presents a
problem for us since the name of the archive is stored in a final field of the internal
archive. The only way I could figure out how to append a derived extension for the archive
was to wrap the internal archive in the constructor of the specified archive and override
getName(). I'm not sure whether you want to accept this approach, but it does work.
{quote}
If this is OK, I'll go ahead and implement it like it stands in the patch.
Make archive name optional in ShrinkWrap#create()
-------------------------------------------------
Key: SHRINKWRAP-163
URL:
https://jira.jboss.org/browse/SHRINKWRAP-163
Project: ShrinkWrap
Issue Type: Feature Request
Components: api
Affects Versions: 1.0.0-alpha-9
Reporter: Dan Allen
Assignee: Ken Gullaksen
Fix For: 1.0.0-alpha-10
Attachments: SHRINKWRAP-163-v1.txt
Make the Archive type first in the API, as it allows us to introduce defaults for the
name and even introduce an extension constant.
ShrinkWrap.create(Class<T> type)
ShrinkWrap.create(Class<T> type, String name)
ShrinkWrap.create(Class<T> type, ExtensionType ext) ***maybe
ShrinkWrap.create(Class<T> type, String name, ExtensionType ext) ***maybe
For the simplest case (Weld SE Arquillian tests for instance), the name would be
defaulted.
ShrinkWrap.create(JavaArchive.class)
The current usage would be flipped
ShrinkWrap.create(JavaArchive.class, "test.jar")
We could consider getting rid of the string-based extension classifier
ShrinkWrap.create(JavaArchive.class, "test", JAR)
Or, if you wanted to specify just an extension (for instance to create a WAR), you could
do:
ShrinkWrap.create(JavaArchive.class, WAR)
To take another angle, maybe the extension can be implied based on the archive type:
JavaArchive = ".jar"
EnterpriseArchive = ".ear"
WebArchive = ".war"
In that case, we can just get back to:
ShrinkWrap.create(WebArchive.class)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira