Description
Hi, there are multiple versions of commons-io:commons-io:jar in us.codecraft:webmagic-selenium:jar:0.7.3. As shown in the following dependency tree, only
the older version commons-io:commons-io:jar:1.3.2 will be loaded and the newer versions are shadowed, according to "Maven's nearest wins strategy", during the packaging process.
However, the method <org.apache.commons.io.FileUtils: boolean deleteQuietly(java.io.File)> only included in >commons-io 2.x. As a result, an exception may be thrown when your project referencing the missing method.
Dependency tree
us.codecraft:webmagic-selenium:jar:0.7.3
+- org.seleniumhq.selenium:selenium-java:jar:2.41.0:compile
| +- org.seleniumhq.selenium:selenium-chrome-driver:jar:2.41.0:compile
| | - (org.seleniumhq.selenium:selenium-remote-driver:jar:2.41.0:compile - omitted for duplicate)
| +- org.seleniumhq.selenium:selenium-htmlunit-driver:jar:2.41.0:compile
| | +- (org.seleniumhq.selenium:selenium-remote-driver:jar:2.41.0:compile - omitted for duplicate)
| | +- net.sourceforge.htmlunit:htmlunit:jar:2.13:compile
| | | +- xalan:xalan:jar:2.7.1:compile
| | | +- net.sourceforge.cssparser:cssparser:jar:0.9.11:compile
| | | | - org.w3c.css:sac:jar:1.3:compile
| | | +- (commons-io:commons-io:jar:2.4:compile - omitted for conflict with 2.2)
| | | +- (commons-logging:commons-logging:jar:1.1.3:compile - omitted for conflict with 1.2)
| | | - org.eclipse.jetty:jetty-websocket:jar:8.1.12.v20130726:compile
| | | +- org.eclipse.jetty:jetty-util:jar:8.1.12.v20130726:compile
| | | +- org.eclipse.jetty:jetty-io:jar:8.1.12.v20130726:compile
| | | | - (org.eclipse.jetty:jetty-util:jar:8.1.12.v20130726:compile - omitted for duplicate)
| | | - org.eclipse.jetty:jetty-http:jar:8.1.12.v20130726:compile
| | | - (org.eclipse.jetty:jetty-io:jar:8.1.12.v20130726:compile - omitted for duplicate)
| | - (org.apache.httpcomponents:httpclient:jar:4.5.2:compile - version managed from 4.3.1; omitted for duplicate)
| +- org.seleniumhq.selenium:selenium-firefox-driver:jar:2.41.0:compile
| | +- (org.seleniumhq.selenium:selenium-remote-driver:jar:2.41.0:compile - omitted for duplicate)
| | +- (commons-io:commons-io:jar:2.2:compile - omitted for conflict with 1.3.2)
| | - org.apache.commons:commons-exec:jar:1.1:compile
| +- org.seleniumhq.selenium:selenium-support:jar:2.41.0:compile
| | - org.seleniumhq.selenium:selenium-api:jar:2.41.0:compile
| | +- (com.google.guava:guava:jar:15.0:compile - omitted for duplicate)
| | - (org.json:json:jar:20080701:compile - omitted for duplicate)
| - org.webbitserver:webbit:jar:0.4.14:compile
| - io.netty:netty:jar:3.5.2.Final:compile
+- us.codecraft:webmagic-core:jar:0.7.3:compile
| +- org.apache.httpcomponents:httpclient:jar:4.5.2:compile
| | +- org.apache.httpcomponents:httpcore:jar:4.4.4:compile
| | +- commons-logging:commons-logging:jar:1.2:compile
| | - commons-codec:commons-codec:jar:1.9:compile
| +- org.jsoup:jsoup:jar:1.10.3:compile
| +- commons-io:commons-io:jar:1.3.2:compile
| +- com.jayway.jsonpath:json-path:jar:2.4.0:compile
| | +- net.minidev:json-smart:jar:2.3:compile
| | | - net.minidev:accessors-smart:jar:1.2:compile
| | | - org.ow2.asm:asm:jar:5.0.4:compile
| | - (org.slf4j:slf4j-api:jar:1.7.6:compile - version managed from 1.7.25; omitted for duplicate)
| - com.alibaba:fastjson:jar:1.2.28:compile
Solution
Upgrade commons-io to 2.4.
Thanks,
Regards,
Leo