java-我可以只使用蜡染布库的代码转换器,而不使用所有其他蜡染布代码和依赖项吗?
作者:互联网
我正在尝试使用Batik库源,我只想使用转码器将SVG文件仅转换为PNG或JPEG. Batik Rasterizer的发行版大约为55k,但是当我导出jar文件时,其为7兆.我可以只使用转码器而不使用库中的所有jar吗?我正在Coldfusion中加载jar文件.仅使用发行版会更有意义吗?
解决方法:
这是蜡染代码转换器1.6-1的依赖树,使用mvn依赖项:tree -Dverbose:
[INFO] +- batik:batik-transcoder:jar:1.6-1:compile
[INFO] | +- batik:batik-bridge:jar:1.6-1:compile
[INFO] | | +- batik:batik-gvt:jar:1.6-1:compile
[INFO] | | | \- batik:batik-awt-util:jar:1.6-1:compile
[INFO] | | | \- batik:batik-util:jar:1.6-1:compile
[INFO] | | | \- (batik:batik-gui-util:jar:1.6-1:compile - omitted for duplicate)
[INFO] | | +- (batik:batik-bridge:jar:1.6-1:compile - omitted for cycle)
[INFO] | | +- batik:batik-script:jar:1.6-1:compile
[INFO] | | \- batik:batik-svg-dom:jar:1.6-1:compile
[INFO] | | +- batik:batik-dom:jar:1.6-1:compile
[INFO] | | | +- batik:batik-css:jar:1.6-1:compile
[INFO] | | | | \- (batik:batik-util:jar:1.6-1:compile - omitted for duplicate)
[INFO] | | | +- batik:batik-xml:jar:1.6-1:compile
[INFO] | | | | \- (batik:batik-util:jar:1.6-1:compile - omitted for duplicate)
[INFO] | | | \- (xerces:xercesImpl:jar:2.5.0:compile - omitted for conflict with 2.2.1)
[INFO] | | \- batik:batik-parser:jar:1.6-1:compile
[INFO] | | \- (batik:batik-awt-util:jar:1.6-1:compile - omitted for duplicate)
[INFO] | \- fop:fop:jar:0.20.5:compile
[INFO] | +- batik:batik-1.5-fop:jar:0.20-5:compile
[INFO] | +- xml-apis:xml-apis:jar:1.0.b2:compile
[INFO] | +- (xalan:xalan:jar:2.4.1:compile - omitted for duplicate)
[INFO] | +- xerces:xercesImpl:jar:2.2.1:compile
[INFO] | \- avalon-framework:avalon-framework:jar:4.0:compile
[INFO] +- batik:batik-gui-util:jar:1.6-1:provided (scope not updated to compile)
[INFO] | \- (batik:batik-ext:jar:1.6-1:provided - omitted for duplicate)
[INFO] +- batik:batik-ext:jar:1.6-1:provided
[INFO] | \- xml-apis:xmlParserAPIs:jar:2.0.2:provided
[INFO] +- rhino:js:jar:1.5R4.1:provided
[INFO] \- xalan:xalan:jar:2.4.1:provided (scope not updated to compile)
如果您使用Maven,则可以将某些依赖项设置为< scope>提供的< / scope>
例如,我可以排除这些没有问题的地方,这为我节省了时间. 1.6MB:
<dependencies>
...
<dependency>
<groupId>batik</groupId>
<artifactId>batik-gui-util</artifactId>
<version>1.6-1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>batik</groupId>
<artifactId>batik-ext</artifactId>
<version>1.6-1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>rhino</groupId>
<artifactId>js</artifactId>
<version>1.5R4.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<version>2.4.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
似乎这些是最大的依赖项:
http://repo.maven.apache.org/maven2/xerces/xercesImpl/2.2.1/xercesImpl-2.2.1.jar (816 KB at 851.9 KB/sec)
http://repo.maven.apache.org/maven2/xalan/xalan/2.4.1/xalan-2.4.1.jar (1007 KB at 479.7 KB/sec)
http://repo.maven.apache.org/maven2/fop/fop/0.20.5/fop-0.20.5.jar (1485 KB at 1011.7 KB/sec)
http://repo.maven.apache.org/maven2/batik/batik-1.5-fop/0.20-5/batik-1.5-fop-0.20-5.jar (2063 KB at 936.0 KB/sec)
标签:coldfusion,batik,java 来源: https://codeday.me/bug/20191101/1986297.html