zentol commented on a change in pull request #15827:
URL: https://github.com/apache/flink/pull/15827#discussion_r627324267
##########
File path: pom.xml
##########
@@ -1740,8 +1742,21 @@ under the License.
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
- <!-- Globally
exclude maven metadata, because it may accidentally bundle files we don't
intend to -->
-
<exclude>META-INF/maven/**</exclude>
+ <!--
META-INF/maven can contain 2 things:
+ - For
archetypes, it contains an archetype-metadata.xml.
+ - For
other jars, it contains the pom for all dependencies under the respective
<groupId>/<artifactId>/ directory.
+
+ We want
to exclude the poms because they may be under an incompatible license,
+ however
the archetype metadata is required and we need to keep that around.
+
+ This
pattern excludes directories under META-INF/maven.
+
('?*/**' does not work because '**' also matches zero directories;
+
everything that matches '?*' also matches '?*/**')
+
+ The
initial '**' allows the pattern to also work for multi-release jars that may
contain such entries under
+
'META-INF/versions/11/META-INF/maven/'.
+ -->
+
<exclude>**/META-INF/maven/?*/?*/**</exclude>
Review comment:
I had the same idea, but don't think it would work because exclusions
are used to narrow down inclusions.
The default inclusion is `*`, matching all files and we exclude some of
those..
If set an inclusion for `archetype-metadata.xml`, then all other files are
implicitly excluded. We'd need include for everything we truly want in the jar,
but that seems like more overhead than the current approach.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]