I have some concerns over the changes [1][2] to add nested jars onto the classpath of a jar contribution without consulting the manifest.

Jar is a standard packaging scheme [3] in java, we shouldn't try to invent a new classloading behavior. For jar, the Class-Path header in META-INF/MANIFEST.MF is used to extend the classpath.

Other standard archives such as JEE EAR/WAR or OSGi bundle (Bundle-ClassPath) defines how the nested jars are honored using additional manifest files or deployment descriptors. We should respect them.

There is no standard way to deal with zip in Java classloading. I'm fine with the default behavior to include all nested jars on the classpath. Maybe we should also require a manifest file in the zip to provide the inner jars to the classpath.

[1] http://svn.apache.org/viewvc?rev=761236&view=rev
[2] http://svn.apache.org/viewvc?rev=761611&view=rev
[3] http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html

Thanks,
Raymond

--------------------------------------------------
From: "ant elder" <[email protected]>
Sent: Thursday, April 02, 2009 6:06 AM
To: <[email protected]>
Subject: Re: Folder and ZIP format contributions containing nested application JARs

On Thu, Apr 2, 2009 at 11:24 AM, ant elder <[email protected]> wrote:
On Sat, Jan 24, 2009 at 10:10 AM, ant elder <[email protected]> wrote:
Yep, and we do already support zip contributions, this applies to folder
contributions too. In both of those the code already finds various artifacts within the contribution like wsdl or xsd files, i think its "just" a matter of adding similar support to find the jar files and get them added to the contribution classpath. I've raised TUSCANY-2786 to track this, seems like
there is consensus emerging that this would be a useful thing to do.

   ...ant

I was asked off list by a user about when we'd be supporting this,
I've asked them to post to the ML about it but in the meantime i had a
quick go at adding support for this in 2.x r761236. Its work in
progress and presently jars within zips get copied to temporary files
which doesn't seem ideal, but its enough to get the two itests for zip
and folder contributions running. Comments on better approaches
welcome.

  ...ant


and if we're going to support zip contributions there are some other
things that would be nice to do:

- a maven plugin for creating zip contributions. You could do it with
the maven assembly plugin but it would be nice to simplify that so you
can do something like just have <packaging>sca-zip</packaging> in the
pom.xml and perhaps a simple way to include/exclude dependency jars
that get included in the zip.

- an archetype to create sca zip contribution projects

- update the webapp runtime so it can use jar and zip contributions as
well as the existing way of having everything in web-inf/classes

...ant

Reply via email to