Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are Java archive file structure Specifications?

I'm completely mystified that I can't (easily!) find Oracle's latest reference specifications for JAR, WAR and EAR file structures. By this I mean:

JARs

  • File structure for JAR
  • Contents and structure of MANIFEST-INF
  • Schema for latest version MANIFEST.MF

WARs

  • File structure for a WAR
  • Contents and structure of MANIFEST-INF
  • Contents and structure of WEB-INF
  • Schema for latest version of web.xml or any other config files

EARs

  • File structure for an EAR
  • Schema for latest version of application.xml and any other config files

Not only can I not find any of these items, I can't even find something off the Oracle site (docs.oracle.*) entitled "WAR File Specification", "EAR File Specification" or their likes. Am I completely missing something here?

The search results I do find are for servlet specifications, and old versions of servlets at that (2.2, etc.).

I'm looking for the definitive URLs that tell me exactly how I need to structure and configure my JARs, WARs and EARs according to the latest specs. Thanks in advance.

like image 765
IAmYourFaja Avatar asked Jul 04 '12 17:07

IAmYourFaja


2 Answers

(I assume you meant META-INF and not MANIFEST-INF...)

  • JARs:

    Latest is Java7, see http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html for all of the three listed above:

    • Contents and structure of META-INF: http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html#The_META-INF_directory
    • File structure for JAR: http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html#Intro
    • Schema for latest version MANIFEST.MF: http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html#Section-Specification


  • WARs

    • Structure and contents see: http://download.oracle.com/otndocs/jcp/servlet-2.4-fr-spec-oth-JSpec/
    • Schema for web.xml: http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd


  • EARs
    • Structure and contents is union of above, for deployment spec see: http://jcp.org/en/jsr/detail?id=088
    • Schema for application.xml: http://java.sun.com/xml/ns/javaee/application_6.xsd

All these specs are quite "normalized", i.e. distributed and referencing various other sources. Since Oracle took over Sun all the links are in the same lousy state as all the other Oracle documentation :-/

Hope that helps.

like image 85
GWu Avatar answered Sep 27 '22 17:09

GWu


Is Packaging Applications - The Java EE 6 Tutorial what you seek?

Update

I normally hesitate to post links I found from the Wikipedia pages, but some of these look like the latest specifications (Java 6) and are quite detailed.

  • JAR
    • Overview
    • File specification
  • WAR
    • Servlet 2.5 WAR Schema
  • EAR
    • Packaging Applications (same as above)

Java EE : XML Schemas for Java EE Deployment Descriptors is tagged as December 10th, 2009 but states that it is the latest version.

like image 25
David Harkness Avatar answered Sep 27 '22 16:09

David Harkness