Skip to content

Commit 7d41e19

Browse files
cpovirkGoogle Java Core Libraries
authored andcommitted
Include LICENSE in the generated jar under META-INF.
Fixes #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](#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
1 parent b0d85c3 commit 7d41e19

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

android/pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@
7171
<testSourceDirectory>test</testSourceDirectory>
7272
<resources>
7373
<resource>
74-
<directory>src</directory>
75-
<excludes>
76-
<exclude>**/*.java</exclude>
77-
<exclude>**/*.sw*</exclude>
78-
</excludes>
74+
<directory>../..</directory>
75+
<includes>
76+
<include>LICENSE</include>
77+
</includes>
78+
<targetPath>META-INF</targetPath>
7979
</resource>
8080
</resources>
8181
<testResources>

pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@
7272
<testSourceDirectory>test</testSourceDirectory>
7373
<resources>
7474
<resource>
75-
<directory>src</directory>
76-
<excludes>
77-
<exclude>**/*.java</exclude>
78-
<exclude>**/*.sw*</exclude>
79-
</excludes>
75+
<directory>..</directory>
76+
<includes>
77+
<include>LICENSE</include>
78+
</includes>
79+
<targetPath>META-INF</targetPath>
8080
</resource>
8181
</resources>
8282
<testResources>

0 commit comments

Comments
 (0)