loki4j / loki-logback-appender

Fast and lightweight implementation of Logback appender for Grafana Loki
https://loki4j.github.io/loki-logback-appender/
BSD 2-Clause "Simplified" License
314 stars 27 forks source link

Gradle build error when protobuf is added to the project - duplicate class com.google.protobuf.* #123

Closed mjfryc closed 3 years ago

mjfryc commented 3 years ago

When gradle project depends on loki-logback-appender and com.google.protobuf:protobuf-java:

dependencies {
    implementation("com.github.loki4j:loki-logback-appender:1.2.0")
    implementation "com.google.protobuf:protobuf-java:$protobuf_version"
}

There is following build error:

Duplicate class com.google.protobuf.DescriptorProtos found in modules jetified-loki-logback-appender-1.2.0 (com.github.loki4j:loki-logback-appender:1.2.0) and jetified-protobuf-java-3.17.3 (com.google.protobuf:protobuf-java:3.17.3)
Duplicate class com.google.protobuf.DescriptorProtos$DescriptorProto found in modules jetified-loki-logback-appender-1.2.0 (com.github.loki4j:loki-logback-appender:1.2.0) and jetified-protobuf-java-3.17.3 (com.google.protobuf:protobuf-java:3.17.3)
Duplicate class com.google.protobuf.DescriptorProtos$DescriptorProto$1 found in modules jetified-loki-logback-appender-1.2.0 (com.github.loki4j:loki-logback-appender:1.2.0) and jetified-protobuf-java-3.17.3 (com.google.protobuf:protobuf-java:3.17.3)
Duplicate class com.google.protobuf.DescriptorProtos$DescriptorProto$Builder found in modules jetified-loki-logback-appender-1.2.0 (com.github.loki4j:loki-logback-appender:1.2.0) and jetified-protobuf-java-3.17.3 (com.google.protobuf:protobuf-java:3.17.3)
Duplicate class com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange found in modules jetified-loki-logback-appender-1.2.0 (com.github.loki4j:loki-logback-appender:1.2.0) and jetified-protobuf-java-3.17.3 (com.google.protobuf:protobuf-java:3.17.3)
Duplicate class com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$1 found in modules jetified-loki-logback-appender-1.2.0 (com.github.loki4j:loki-logback-appender:1.2.0) and jetified-protobuf-java-3.17.3 (com.google.protobuf:protobuf-java:3.17.3)
...
nehaev commented 3 years ago

Duplicate of #122

nehaev commented 3 years ago

Hi @mjfryc,

Thanks for reporting this! We already have a similar issue #122 (though it's hard to guess by name). So you can track the progress on fixing this there.