Project used class like org.codehaus.plexus.PlexusContainer We can remove direct dependency because we have transitive dependency from other artifacts - of course we needn't remove it.
[INFO] --- maven-dependency-plugin:2.10:tree (default-cli) @ maven-site-plugin --- [WARNING] Using Maven 2 dependency tree to get verbose output, which may be inconsistent with actual Maven 3 resolution [INFO] org.apache.maven.plugins:maven-site-plugin:maven-plugin:3.10.0-SNAPSHOT [INFO] +- org.apache.maven:maven-compat:jar:3.0.5:provided [INFO] | \- (org.sonatype.sisu:sisu-inject-plexus:jar:2.3.0:compile - scope updated from provided; omitted for duplicate) [INFO] +- org.apache.maven:maven-core:jar:3.0.5:compile [INFO] | \- (org.sonatype.sisu:sisu-inject-plexus:jar:2.3.0:compile - omitted for conflict with 1.4.2) [INFO] +- org.apache.maven:maven-plugin-api:jar:3.0.5:compile [INFO] | \- (org.sonatype.sisu:sisu-inject-plexus:jar:2.3.0:compile - omitted for duplicate) [INFO] \- org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2:compile Another case is that the same classes are placed in two separate artifact, so class org.codehaus.plexus.PlexusContainer can be found in *org.sonatype.sisu:sisu-inject-plexus *and *org.codehaus.plexus:plexus-container-default* Project has dependency which provide *org.codehaus.plexus:plexus-container-default* [INFO] --- maven-dependency-plugin:2.10:tree (default-cli) @ maven-site-plugin --- [WARNING] Using Maven 2 dependency tree to get verbose output, which may be inconsistent with actual Maven 3 resolution [INFO] org.apache.maven.plugins:maven-site-plugin:maven-plugin:3.10.0-SNAPSHOT [INFO] +- org.apache.maven.doxia:doxia-sink-api:jar:1.9.1:compile [INFO] | \- org.apache.maven.doxia:doxia-logging-api:jar:1.9.1:compile [INFO] | \- (org.codehaus.plexus:plexus-container-default:jar:1.7.1:compile - omitted for duplicate) [INFO] +- org.apache.maven.doxia:doxia-core:jar:1.9.1:compile [INFO] | \- org.codehaus.plexus:plexus-container-default:jar:1.7.1:compile [INFO] +- org.apache.maven.doxia:doxia-site-renderer:jar:1.9.2:compile [INFO] | +- (org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-30:compile - omitted for conflict with 1.7.1) [INFO] | \- org.codehaus.plexus:plexus-velocity:jar:1.2:compile [INFO] | \- (org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile - omitted for conflict with 1.7.1) [INFO] \- org.apache.maven.doxia:doxia-integration-tools:jar:1.9.2:compile [INFO] \- (org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9:compile - omitted for conflict with 1.7.1) I don't know if it is good when a plugin has the same class from different dependencies and which one will be used in runtime. It is possible that unit tests will use different implementations than plugin running by maven. wt., 9 lut 2021 o 16:01 Elliotte Rusty Harold <[email protected]> napisał(a): > Seems maven dependency:analyze thinks we need this one. At least it > doesn't call it out as unused: > > [WARNING] Used undeclared dependencies found: > [WARNING] javax.servlet:javax.servlet-api:jar:3.1.0:compile > [WARNING] Unused declared dependencies found: > [WARNING] org.apache.maven.doxia:doxia-core:jar:1.9.1:compile > [WARNING] org.apache.maven.doxia:doxia-module-xhtml:jar:1.9.1:compile > [WARNING] org.apache.maven.doxia:doxia-module-xhtml5:jar:1.9.1:compile > [WARNING] org.apache.maven.doxia:doxia-module-apt:jar:1.9.1:runtime > [WARNING] org.apache.maven.doxia:doxia-module-fml:jar:1.9.1:runtime > [WARNING] org.apache.maven.doxia:doxia-module-markdown:jar:1.9.1:runtime > [WARNING] > org.apache.maven.doxia:doxia-module-confluence:jar:1.9.1:runtime > [WARNING] > org.apache.maven.doxia:doxia-module-docbook-simple:jar:1.9.1:runtime > [WARNING] org.apache.maven.doxia:doxia-module-twiki:jar:1.9.1:runtime > [WARNING] org.apache.maven.wagon:wagon-webdav-jackrabbit:jar:3.3.1:test > [WARNING] org.eclipse.jetty:jetty-client:jar:9.2.29.v20191105:test > [WARNING] org.slf4j:slf4j-simple:jar:1.5.3:test > [WARNING] org.slf4j:jcl-over-slf4j:jar:1.6.1:test > > On Tue, Feb 9, 2021 at 2:58 PM Elliotte Rusty Harold <[email protected]> > wrote: > > > > What does maven dependency:analyze say? > > > > On Tue, Feb 9, 2021 at 2:25 PM Emmanuel Bourg <[email protected]> wrote: > > > > > > Hi, > > > > > > maven-site-plugin has a dependency on sisu-inject-plexus [1] but it > > > doesn't seem to be used. The project still builds and the tests pass > > > without it. > > > > > > Is it safe to assume it can be removed? > > > > > > Emmanuel Bourg > > > > > > [1] > > > > https://github.com/apache/maven-site-plugin/blob/maven-site-plugin-3.9.1/pom.xml#L284 > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [email protected] > > > For additional commands, e-mail: [email protected] > > > > > > > > > -- > > Elliotte Rusty Harold > > [email protected] > > > > -- > Elliotte Rusty Harold > [email protected] > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- Sławomir Jaranowski
