On 06/02/2008, at 8:05 AM, Dan Fabulich wrote:


In Surefire 2.4, we stopped having surefire-booter depend directly on plexus-archiver. We did that partly to workaround MSHADE-9 and partly to simply reduce the number of dependencies in surefire- booter (which unfortunately has to be in the classpath of the launched tests).

Our dependency on plexus-archiver was minimal: all we needed to do was write out an empty jar with a manifest in it. I attempted to copy the relevant code out of plexus-archiver and use just a few lines in surefire-booter in a simple class called ManifestJarWriter.

http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ManifestJarWriter.java http://tinyurl.com/2adoec

In SUREFIRE-445, it was pointed out that there's some bugs in that code in Surefire (for example, it doesn't include a ManifestVersion); a patch is included. But the patch also does something interesting: it basically guts ManifestJarWriter, in favor of a class that I didn't happen to know about: java.util.jar.Manifest.

I like the idea of this change (why maintain our own code to write manifests?) but it makes me suspicious... Surely there was some reason why plexus-archiver had reinvented the wheel here; probably to fix a bug or something.

Is this just a case where we've accidentally reinvented a class that's been available in the JDK since 1.2? Is there something else more complex going on here that I don't quite understand? Should I use java.util.jar.Manifest, or prefer to maintain the logic myself?

I suspect it may have been to do some things the default class didn't do, under certain circumstances. You would hope there was documentation for such things :) It could just be that the code was copied from Ant and Ant wanted to support 1.1. But I don't know for certain - and I doubt it affects Surefire - so perhaps going with the standard classes is the way to go.

- Brett


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to