siom79 / japicmp

Comparison of two versions of a jar archive
https://siom79.github.io/japicmp
Apache License 2.0
712 stars 107 forks source link

mvn site fails because optional dependencies cannot be found. #230

Closed garydgregory closed 5 years ago

garydgregory commented 5 years ago

mvn site fails because optional dependencies are not considered:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:53 min
[INFO] Finished at: 2019-03-25T11:50:13-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.7.1:site (default-site) on project commons-configuration2: Error generating japicmp-maven-plugin:0.13.1:cmp-report report: Failed to generate report: Could not load 'Class not found: org.apache.commons.jxpath.ri.model.NodeIterator': org.apache.commons.jxpath.ri.model.NodeIterator. Please make sure that all libraries have been added to the classpath (CLASSPATH=;C:\Users\ggregory\.m2\repository\org\apache\commons\commons-text\1.6\commons-text-1.6.jar;C:\Users\ggregory\.m2\repository\org\apache\commons\commons-lang3\3.8.1\commons-lang3-3.8.1.jar;C:\Users\ggregory\.m2\repository\commons-collections\commons-collections\3.2.2\commons-collections-3.2.2.jar;C:\Users\ggregory\.m2\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar;C:\Users\ggregory\.m2\repository\javax\servlet\servlet-api\2.4\servlet-api-2.4.jar;) or try the option '--ignore-missing-classes'. -> [Help 1]

Reproduce:

git clone -n https://gitbox.apache.org/repos/asf/commons-configuration
cd commons-configuration
git checkout 19495e915b4fba72e624866d589e1cf6ab210f9a
mvn clean package site -Ddoclint=none
siom79 commented 5 years ago

Yes, optional dependencies are ignored (see here). According to this page projects that actually need an optional dependency must redeclare it.

So you assume that the users of your library will redeclare the optional dependency and therefore you want it to be on the classpath when analyzing it with japicmp?

siom79 commented 5 years ago

I have changed japicmp such that it includes per default optional dependencies. You can use the new option ignoreMissingOptionalDependency to ignore missing optional dependencies.

@garydgregory Thanks for the description on how to reproduce.

garydgregory commented 5 years ago

@siom79 Thank you! When can we expect the next release?

garydgregory commented 5 years ago

Ping.

siom79 commented 5 years ago

Released with 0.14.0.