batik-bridge does not declare xmlgraphics-commons dependency
Curtis Rueden <[email protected]> Tue, 6 Jun 2017 13:07:33 -0500
| Newsgroups | gmane.text.xml.batik.user |
|---|---|
| Message-ID | <CADN69ykk9YbfpcGqALQdDL8DcY=V4==T97Q68p3e63ouuQyA+Q@mail.gmail.com> |
--94eb2c1bfe9039817f05514e80ff Content-Type: text/plain; charset="UTF-8" Hi everyone, I maintain some projects which use Batik for reading SVG files [1]. All works very well; thank you very much for this great library! These projects depend on batik components via Maven. I noticed that batik-bridge requires xmlgraphics-commons, but does not declare it in its POM. So without xmlgraphics-commons on the classpath, there are runtime errors like: java.lang.NoClassDefFoundError: org/apache/xmlgraphics/java2d/color/DeviceCMYKColorSpace at org.apache.batik.bridge.SVGShapeElementBridge.createShapePainter(SVGShapeElementBridge.java:117) at org.apache.batik.bridge.SVGDecoratedShapeElementBridge.createFillStrokePainter(SVGDecoratedShapeElementBridge.java:58) at org.apache.batik.bridge.SVGDecoratedShapeElementBridge.createShapePainter(SVGDecoratedShapeElementBridge.java:84) at org.apache.batik.bridge.SVGShapeElementBridge.buildGraphicsNode(SVGShapeElementBridge.java:91) at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:224) at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:171) at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:82) at sc.fiji.io.SVG_Reader.run(SVG_Reader.java:53) If you look at the POM on Maven Central [2], you'll see that xmlgraphics-commons is not one of the dependencies. But if you look at the POM of the release tag [3], you'll see that it is. Apparently there was a similar issue back in 2015, but it was fixed [4]. Similarly, batik-constants seems to be required even at compile time; without it, javac says: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.0:compile (default-compile) on project IO_: Compilation failure [ERROR] /Users/curtis/code/fiji/IO/src/main/java/sc/fiji/io/SVG_Reader.java:[53,33] cannot access org.apache.batik.util.XMLConstants [ERROR] class file for org.apache.batik.util.XMLConstants not found Where the line of code in question has no direct reference to XMLConstants. (As an aside: in contrast to javac, the Eclipse compiler does not complain about this when batik-constants is missing from the compile-time classpath.) To work around this problem, we declare batik-constants and xmlgraphics-commons explicitly as dependencies [5]. I am curious if this dependency weirdness is a known issue, and if a fix is planned? Regards, Curtis [1] E.g.: https://github.com/fiji/IO/blob/IO_-3.0.3/src/main/java/sc/fiji/io/SVG_Reader.java [2] http://repo1.maven.org/maven2/org/apache/xmlgraphics/batik-bridge/1.9/batik-bridge-1.9.pom [3] https://github.com/apache/batik/blob/batik-1_9/batik-bridge/pom.xml#L88-L92 [4] https://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/201502.mbox/%[email protected]%3E [5] https://github.com/fiji/IO/blob/e4da7347bee797daf5708b7045090eb90daf849b/pom.xml#L234-L244 -- Curtis Rueden LOCI software architect - https://loci.wisc.edu/software ImageJ2 lead, Fiji maintainer - https://imagej.net/User:Rueden Did you know ImageJ has a forum? http://forum.imagej.net/ --94eb2c1bfe9039817f05514e80ff Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Hi everyone,<div><br></div><div>I maintain some projects w= hich use Batik for reading SVG files [1]. All works very well; thank you ve= ry much for this great library!</div><div><br></div><div>These projects dep= end on batik components via Maven. I noticed that batik-bridge requires xml= graphics-commons, but does not declare it in its POM. So without xmlgraphic= s-commons on the classpath, there are runtime errors like:</div><div><br></= div><div><div>java.lang.NoClassDefFoundError: org/apache/xmlgraphics/java2d= /color/DeviceCMYKColorSpace</div><div><span class=3D"gmail-Apple-tab-span" = style=3D"white-space:pre"> </span>at org.apache.batik.bridge.SVGShapeElemen= tBridge.createShapePainter(SVGShapeElementBridge.java:117)</div><div><span = class=3D"gmail-Apple-tab-span" style=3D"white-space:pre"> </span>at org.apa= che.batik.bridge.SVGDecoratedShapeElementBridge.createFillStrokePainter(SVG= DecoratedShapeElementBridge.java:58)</div><div><span class=3D"gmail-Apple-t= ab-span" style=3D"white-space:pre"> </span>at org.apache.batik.bridge.SVGDe= coratedShapeElementBridge.createShapePainter(SVGDecoratedShapeElementBridge= .java:84)</div><div><span class=3D"gmail-Apple-tab-span" style=3D"white-spa= ce:pre"> </span>at org.apache.batik.bridge.SVGShapeElementBridge.buildGraph= icsNode(SVGShapeElementBridge.java:91)</div><div><span class=3D"gmail-Apple= -tab-span" style=3D"white-space:pre"> </span>at org.apache.batik.bridge.GVT= Builder.buildGraphicsNode(GVTBuilder.java:224)</div><div><span class=3D"gma= il-Apple-tab-span" style=3D"white-space:pre"> </span>at org.apache.batik.br= idge.GVTBuilder.buildComposite(GVTBuilder.java:171)</div><div><span class= =3D"gmail-Apple-tab-span" style=3D"white-space:pre"> </span>at org.apache.b= atik.bridge.GVTBuilder.build(GVTBuilder.java:82)</div><div><span class=3D"g= mail-Apple-tab-span" style=3D"white-space:pre"> </span>at sc.fiji.io.SVG_Re= ader.run(SVG_Reader.java:53)</div></div><div><br></div><div>If you look at = the POM on Maven Central [2], you'll see that xmlgraphics-commons is no= t one of the dependencies. But if you look at the POM of the release tag [3= ], you'll see that it is. Apparently there was a similar issue back in = 2015, but it was fixed [4].</div><div><br></div><div>Similarly, batik-const= ants seems to be required even at compile time; without it, javac says:</di= v><div><br></div><div><div>=C2=A0 [ERROR] Failed to execute goal org.apache= .maven.plugins:maven-compiler-plugin:3.6.0:compile (default-compile) on pro= ject IO_: Compilation failure</div><div>=C2=A0 [ERROR] /Users/curtis/code/f= iji/IO/src/main/java/sc/fiji/io/SVG_Reader.java:[53,33] cannot access org.a= pache.batik.util.XMLConstants</div><div>=C2=A0 [ERROR] =C2=A0 class file fo= r org.apache.batik.util.XMLConstants not found</div></div><div><br></div><d= iv>Where the line of code in question has no direct reference to XMLConstan= ts.</div><div><br></div><div>(As an aside: in contrast to javac, the Eclips= e compiler does not complain about this when batik-constants is missing fro= m the compile-time classpath.)</div><div><br></div><div>To work around this= problem, we declare batik-constants and xmlgraphics-commons explicitly as = dependencies [5].</div><div><br></div><div>I am curious if this dependency = weirdness is a known issue, and if a fix is planned?</div><div><br></div><d= iv>Regards,</div><div>Curtis</div><div><br></div><div>[1] E.g.:=C2=A0<a hre= f=3D"https://github.com/fiji/IO/blob/IO_-3.0.3/src/main/java/sc/fiji/io/SVG= _Reader.java">https://github.com/fiji/IO/blob/IO_-3.0.3/src/main/java/sc/fi= ji/io/SVG_Reader.java</a></div><div><br></div><div>[2]=C2=A0<a href=3D"http= ://repo1.maven.org/maven2/org/apache/xmlgraphics/batik-bridge/1.9/batik-bri= dge-1.9.pom">http://repo1.maven.org/maven2/org/apache/xmlgraphics/batik-bri= dge/1.9/batik-bridge-1.9.pom</a></div><div><br></div><div>[3]=C2=A0<a href= =3D"https://github.com/apache/batik/blob/batik-1_9/batik-bridge/pom.xml#L88= -L92">https://github.com/apache/batik/blob/batik-1_9/batik-bridge/pom.xml#L= 88-L92</a></div><div><br></div><div>[4]=C2=A0<a href=3D"https://mail-archiv= es.apache.org/mod_mbox/xmlgraphics-batik-users/201502.mbox/%3C54CEAF96.6040= [email protected]%3E">https://mail-archives.apache.org/mod_mbox/xmlgraphics-bat= ik-users/201502.mbox/%[email protected]%3E</a></div><div><br></d= iv><div>[5]=C2=A0<a href=3D"https://github.com/fiji/IO/blob/e4da7347bee797d= af5708b7045090eb90daf849b/pom.xml#L234-L244">https://github.com/fiji/IO/blo= b/e4da7347bee797daf5708b7045090eb90daf849b/pom.xml#L234-L244</a></div><div>= <br clear=3D"all"><div><div class=3D"gmail_signature"><div dir=3D"ltr"><div= ><div dir=3D"ltr"><div><div dir=3D"ltr"><div><div dir=3D"ltr"><div><span st= yle=3D"font-size:12.8px">--</span></div><div><span style=3D"font-size:12.8p= x">Curtis Rueden</span><br></div><div><span style=3D"font-size:12.8px">LOCI= software architect - <a href=3D"https://loci.wisc.edu/software" target=3D"= _blank">https://loci.wisc.edu/software</a></span></div><div>ImageJ2 lead, F= iji maintainer -=C2=A0<span style=3D"font-size:12.8px"><a href=3D"https://i= magej.net/User:Rueden" target=3D"_blank">https://imagej.net/User:Rueden</a>= </span></div><div>Did you know ImageJ has a forum? <a href=3D"http://forum.= imagej.net/" target=3D"_blank">http://forum.imagej.net/</a></div><div><br><= /div></div></div></div></div></div></div></div></div></div> </div></div> --94eb2c1bfe9039817f05514e80ff--