[
https://issues.jboss.org/browse/SHRINKWRAP-266?page=com.atlassian.jira.pl...
]
Andrew Rubinger commented on SHRINKWRAP-266:
--------------------------------------------
History of the decision to not do a straight "WEB-INF/classes/META-INF" as the
manifest location:
WEB-INF/classes/META-INF was deemed to be an anomaly introduced by the persistence spec.
Servlet 3.0 10.6
"Web applications can be packaged and signed into a Web ARchive format (WAR) file
using the standard Java archive tools. For example, an application for issue tracking
might be distributed in an archive file called issuetrack.war. When packaged into such a
form, a META-INF directory will be present which contains information useful to Java
archive tools. This directory must
not be directly served as content by the container in response to a Web client’s request,
though its contents are visible to servlet code via the getResource and
getResourceAsStream calls on the ServletContext. Also, any requests to access the
resources in META-INF directory must be returned with a SC_NOT_FOUND(404) response."
Another reference, 10.7.1, use of extension-list, which is a JAR standard described
META-INF/MANIFEST.MF:
"The application developer depending on such an extension or extensions must provide
a META-INF/MANIFEST.MF entry in the WAR file listing all extensions needed by the WAR. The
format of the manifest entry should follow standard JAR manifest format."
Yet another reference:
"A single file that contains all of the components of a web application. This archive
file is created by using standard JAR tools which allow any or all of the web components
to be signed."
(in the glossary)
Signed is referring to jar signing. The standard tool for signing, jarsigner looks in
META-INF/MANIFEST.MF
And there is also EE 8.2.1:
"A JAR format file (such as a .jar file, .war file, or .rar file) may reference a
.jar file or directory by naming the referenced .jar file or directory in a Class-Path
header in the referencing JAR file’s Manifest file. The referenced .jar file or directory
is named using a URL relative to the URL of the refer- encing JAR file. The Manifest file
is named META-INF/MANIFEST.MF in the JAR file. The Class-Path entry in the Manifest file
is of the form"
Manifest container for WebArchive should be WEB-INF/classes/META-INF
--------------------------------------------------------------------
Key: SHRINKWRAP-266
URL:
https://issues.jboss.org/browse/SHRINKWRAP-266
Project: ShrinkWrap
Issue Type: Bug
Components: impl-base
Affects Versions: 1.0.0-alpha-12
Reporter: Dan Allen
This issue is a regression of SHRINKWRAP-186. The location of the ManifestContainer for a
WebArchive should be /WEB-INF/classes/META-INF, not /META-INF. This location is backed up
by our target locations per archive type page.
http://community.jboss.org/wiki/Containerrootsperspecarchive
A sample use case is bundling a persistence.xml in a web archive:
{code:java}
WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war")
.addAsManifestResource("test-persistence.xml",
"persistence.xml");
System.out.println(war.toString(true));
{code}
Current output:
{code}
test.war
/META-INF/
/META-INF/persistence.xml
{code}
Expected output:
{code}
test.war
/WEB-INF/
/WEB-INF/classes/
/WEB-INF/classes/persistence.xml
{code}
This also breaks the ServiceLoader registrations, as they appear in /META-INF/services/
rather than in /WEB-INF/classes/META-INF/services/
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira