Search code examples
javamaven-2appletclasspathapache-fop

Applet dependency JARs with incompatible Class-Path in MANIFEST.MF


my applet depends on two JAR libraries. Each JAR library has a dependency on xercesImpl-2.2.1.jar. Unfortunately they want this to have different names:

  • Apache FOP 0.20.5

    • Entry in META-INF/MANIFEST.MF: Class-Path: xercesImpl-2.2.1.jar...
  • Apache Xalan 2.4.1

    • Entry in META-INF/MANIFEST.MF: Class-Path: xercesImpl.jar...

xercesImpl-2.2.1.jar is specified in the tag. I can see in the Java console that it is downloaded successfully. However later the console shows an attempt to read xercesImpl.jar which does not exist. It must be getting this from the Xalan manifest because the web application code does not specify xercesImpl.jar anywhere. Obviously it actually already has the contents of this JAR available so it doesn't actually need to load it.

I am using Maven to manage dependencies and would like to continue using these two standard public open source libraries without hacking their manifests. Any suggestions for the best way to resolve this - or should I just live with the spurious error in the Java console?


Solution

  • I'm not a Maven maven, but you're probably best off leaving the dependencies alone and somehow giving your project a 'goal' which involves re-packaging one of the JAR files once they are 'in' your project.

    Possibly one way to do it is to make 'repackaged JAR' artifact depends on the 'fop' artifact, and your project depends on the 'repackaged JAR' artifact. Something like that.