bufbuild / protovalidate-java

Protocol Buffer Validation for Java.
https://central.sonatype.com/artifact/build.buf/protovalidate
Apache License 2.0
37 stars 13 forks source link

[BUG] 2 files found with path 'META-INF/NOTICE.md' #145

Closed stavris8894 closed 3 months ago

stavris8894 commented 3 months ago

Description

I am using the library for an Android application and i am getting the below error:

2 files found with path 'META-INF/NOTICE.md' from inputs:

  • /.gradle/caches/modules-2/files-2.1/jakarta.mail/jakarta.mail-api/2.1.3/a327aa5f514ba86e80d54584417d7376ed2bde0e/jakarta.mail-api-2.1.3.jar
  • /.gradle/caches/modules-2/files-2.1/jakarta.activation/jakarta.activation-api/2.1.3/fa165bd70cda600368eee31555222776a46b881f/jakarta.activation-api-2.1.3.jar

Steps to Reproduce

  1. Add implementation("build.buf:protovalidate:0.2.1") in an Android project
  2. Build the project

Environment

pkwarren commented 3 months ago

Discussed further in https://bufbuild.slack.com/archives/CRZ680FUH/p1718144711351699. Using an existing Android example project, I was able to reproduce the problem but adding:

    packaging {
        resources {
            excludes.add("/META-INF/*")
        }
    }

resolved the issue. These files come from upstream dependencies used to validate email addresses and are out of our control, so it is recommended to add exclusions for Android builds that prevent duplicate files.

Given a sample build file, it was missing enabling either the Android application or library plugin, which means that the excludes weren't having any effect.

There doesn't appear to be anything further to be done. If you'd like us to research further, please provide a minimal example repo we can use to reproduce the problem and help to debug.