From 7d41e19636a1c0e6fbf9275ef1f76f471ab71189 Mon Sep 17 00:00:00 2001 From: cpovirk Date: Mon, 8 May 2023 11:34:22 -0700 Subject: [PATCH] Include `LICENSE` in the generated jar under `META-INF`. Fixes https://github.com/google/guava/issues/6468 I'd looked at [how Guice does this](https://github.com/google/guice/blob/40a5bcfab5cfe45c3b6c5ffc9309b310df82775b/pom.xml#L255-L273), which pulls the Apache license from a remote server (and also generates additional `DEPENDENCIES` and `NOTICE` files). But I figured it was simplest to just point `maven-resources-plugin` at our local `LICENSE` file: `maven-resources-plugin` can work with any license, whereas I'm not sure if Guice's `apache-jar-resource-bundle` approach can. Plus, I want to figure `maven-resources-plugin` out, anyway, for [Proguard purposes](https://github.com/google/guava/issues/2117). Conveniently, I'm pretty confident that our existing `resources` configuration isn't necessary: Maybe it was years ago, but nowadays, we have no results for `find */src android/*/src -type f -not -name '*.java'` (except under `guava-gwt`, which overrides `resources` and which I verified builds an identical jar after this change). RELNOTES=n/a PiperOrigin-RevId: 530360631 --- android/pom.xml | 10 +++++----- pom.xml | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/android/pom.xml b/android/pom.xml index 60d3e6486485..3497659f054c 100644 --- a/android/pom.xml +++ b/android/pom.xml @@ -71,11 +71,11 @@ test - src - - **/*.java - **/*.sw* - + ../.. + + LICENSE + + META-INF diff --git a/pom.xml b/pom.xml index eb77b8d2ccbd..0beba6e55be9 100644 --- a/pom.xml +++ b/pom.xml @@ -72,11 +72,11 @@ test - src - - **/*.java - **/*.sw* - + .. + + LICENSE + + META-INF