eclipse-vertx / vert.x

Vert.x is a tool-kit for building reactive applications on the JVM
http://vertx.io
Other
14.26k stars 2.07k forks source link

Overlapping classes with shade plugin #2163

Closed vegegoku closed 6 years ago

vegegoku commented 6 years ago

Hi the shade plugin is giving the following warning when i build my application

[WARNING] vertx-web-common-3.4.2.jar, vertx-web-3.4.2.jar define 3 overlapping classes: 
[WARNING]   - io.vertx.ext.web.package-info
[WARNING]   - io.vertx.groovy.ext.web.VertxPropertiesModuleFactory
[WARNING]   - io.vertx.groovy.ext.web.VertxPropertiesModuleFactory$1
[WARNING] vertx-service-proxy-3.4.2.jar, vertx-service-proxy-3.4.2-processor.jar define 6 overlapping classes: 
[WARNING]   - io.vertx.serviceproxy.ProxyHandler
[WARNING]   - io.vertx.serviceproxy.ServiceExceptionMessageCodec
[WARNING]   - io.vertx.serviceproxy.ServiceException
[WARNING]   - io.vertx.serviceproxy.ServiceProxyProcessor
[WARNING]   - io.vertx.serviceproxy.package-info
[WARNING]   - io.vertx.serviceproxy.ProxyHelper

my dependency tree is like this

[INFO] me.sample:sample-backend:jar:1.0-SNAPSHOT
[INFO] +- io.vertx:vertx-web:jar:3.4.2:compile <-------------------- here
[INFO] |  +- io.vertx:vertx-auth-common:jar:3.4.2:compile
[INFO] |  \- io.vertx:vertx-core:jar:3.4.2:compile
[INFO] |     +- io.netty:netty-common:jar:4.1.8.Final:compile
[INFO] |     +- io.netty:netty-buffer:jar:4.1.8.Final:compile
[INFO] |     +- io.netty:netty-transport:jar:4.1.8.Final:compile
[INFO] |     +- io.netty:netty-handler:jar:4.1.8.Final:compile
[INFO] |     |  \- io.netty:netty-codec:jar:4.1.8.Final:compile
[INFO] |     +- io.netty:netty-handler-proxy:jar:4.1.8.Final:compile
[INFO] |     |  \- io.netty:netty-codec-socks:jar:4.1.8.Final:compile
[INFO] |     +- io.netty:netty-codec-http:jar:4.1.8.Final:compile
[INFO] |     +- io.netty:netty-codec-http2:jar:4.1.8.Final:compile
[INFO] |     +- io.netty:netty-resolver:jar:4.1.8.Final:compile
[INFO] |     +- io.netty:netty-resolver-dns:jar:4.1.8.Final:compile
[INFO] |     |  \- io.netty:netty-codec-dns:jar:4.1.8.Final:compile
[INFO] |     +- com.fasterxml.jackson.core:jackson-core:jar:2.7.4:compile
[INFO] |     \- com.fasterxml.jackson.core:jackson-databind:jar:2.7.4:compile
[INFO] |        \- com.fasterxml.jackson.core:jackson-annotations:jar:2.7.0:compile
[INFO] +- com.progressoft.brix.domino.api:domino-api-client:jar:1.0-rc.2-SNAPSHOT:compile
[INFO] |  +- com.progressoft.brix.domino.api:domino-api-shared:jar:1.0-rc.2-SNAPSHOT:compile
[INFO] |  +- com.progressoft.brix.domino.api:domino-api-shared:jar:sources:1.0-rc.2-SNAPSHOT:compile
[INFO] |  \- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] +- com.progressoft.brix.domino.api:domino-api-server:jar:1.0-rc.2-SNAPSHOT:compile
[INFO] |  +- com.progressoft.brix.domino:domino-service-discovery:jar:1.0-rc.2-SNAPSHOT:compile
[INFO] |  |  +- io.vertx:vertx-service-discovery:jar:3.4.2:compile
[INFO] |  |  +- io.vertx:vertx-web-client:jar:3.4.2:compile
[INFO] |  |  |  \- io.vertx:vertx-web-common:jar:3.4.2:compile <----------------------- here
[INFO] |  |  +- io.vertx:vertx-service-proxy:jar:3.4.2:compile <-------------------- here
[INFO] |  |  |  \- io.vertx:vertx-lang-js:jar:3.4.2:compile
[INFO] |  |  +- io.vertx:vertx-codegen:jar:3.4.2:compile
[INFO] |  |  |  \- org.mvel:mvel2:jar:2.2.8.Final:compile
[INFO] |  |  +- io.vertx:vertx-service-proxy:jar:processor:3.4.2:compile <-------------------------- here
[INFO] |  |  +- io.vertx:vertx-jdbc-client:jar:3.4.2:compile
[INFO] |  |  |  +- io.vertx:vertx-sql-common:jar:3.4.2:compile
[INFO] |  |  |  \- com.mchange:c3p0:jar:0.9.5.2:compile
[INFO] |  |  |     \- com.mchange:mchange-commons-java:jar:0.2.11:compile
[INFO] |  |  +- io.vertx:vertx-redis-client:jar:3.4.2:compile
[INFO] |  |  \- io.vertx:vertx-mongo-client:jar:3.4.2:compile
[INFO] |  |     \- org.mongodb:mongodb-driver-async:jar:3.4.1:compile
[INFO] |  |        +- org.mongodb:mongodb-driver-core:jar:3.4.1:compile
[INFO] |  |        \- org.mongodb:bson:jar:3.4.1:compile
[INFO] |  \- io.vertx:vertx-config:jar:3.4.2:compile
[INFO] +- com.progressoft.brix.domino:domino-remote-logging:jar:1.0-rc.2-SNAPSHOT:compile
[INFO] |  +- com.google.gwt:gwt-servlet:jar:2.8.1:compile
[INFO] |  +- com.google.code.gson:gson:jar:2.6.2:compile
[INFO] |  +- org.apache.logging.log4j:log4j-api:jar:2.8.2:compile
[INFO] |  \- org.apache.logging.log4j:log4j-core:jar:2.8.2:compile
[INFO] +- me.sample:logme-backend:jar:1.0-SNAPSHOT:compile
[INFO] |  \- com.progressoft.brix.domino.apt:apt-server:jar:1.0-rc.2-SNAPSHOT:compile
[INFO] |     \- com.progressoft.brix.domino.apt:apt-commons:jar:1.0-rc.2-SNAPSHOT:compile
[INFO] |        +- commons-io:commons-io:jar:1.3.2:compile
[INFO] |        \- commons-lang:commons-lang:jar:2.6:compile
[INFO] +- me.sample:logme-shared:jar:1.0-SNAPSHOT:compile
[INFO] |  \- com.google.gwt:gwt-user:jar:2.8.1:compile
[INFO] |     +- com.google.jsinterop:jsinterop-annotations:jar:1.0.1:compile
[INFO] |     +- com.google.jsinterop:jsinterop-annotations:jar:sources:1.0.1:compile
[INFO] |     +- javax.validation:validation-api:jar:sources:1.0.0.GA:compile
[INFO] |     +- javax.servlet:javax.servlet-api:jar:3.1.0:compile
[INFO] |     \- org.w3c.css:sac:jar:1.3:compile
[INFO] +- me.sample:sample-frontend:war:1.0-SNAPSHOT:runtime
[INFO] +- junit:junit:jar:4.12:test
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] +- org.assertj:assertj-core:jar:3.7.0:test
[INFO] \- com.google.auto.service:auto-service:jar:1.0-rc3:provided
[INFO]    +- com.google.auto:auto-common:jar:0.3:provided
[INFO]    \- com.google.guava:guava:jar:19.0:provided

Why do vertx jars have these classes duplication that makes them overlap?

vegegoku commented 6 years ago

any updates on this?

vietj commented 6 years ago

for the first one you should have less conflicts it will still happen but we will work on it for 3.6

for the second one: you have the following dependencies vertx-service-proxy-3.4.2.jar, vertx-service-proxy-3.4.2-processor.jar you should remove one of them, for instance the former, the later is a version of the former that has a few extra classes for annotation processing

keep in mind that does not harm your application at all, just warnings.

vietj commented 6 years ago

I'm closing the issue and it should rather be expressed in the vert-x3/issues tracker

pmlopes commented 6 years ago

This also applies for template engines from the stack as it picks the shaded dependencies:

https://github.com/vert-x3/vertx-stack/blob/master/stack-depchain/pom.xml#L161-L190

vietj commented 6 years ago

all sort of things we want to address in the near future