This is an automated email from the ASF dual-hosted git repository.
voonhous pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git
The following commit(s) were added to refs/heads/master by this push:
new b65bc185695b fix(build): make submodule builds find the checkstyle
import-control file (#19420)
b65bc185695b is described below
commit b65bc185695bc114f319a1a0a2c58642c9097408
Author: Ranga Reddy <[email protected]>
AuthorDate: Mon Aug 3 12:21:28 2026 +0530
fix(build): make submodule builds find the checkstyle import-control file
(#19420)
* fix(build): make submodule builds find the checkstyle import-control file
Building a single module from inside its own directory failed:
cd hudi-cli && mvn checkstyle:check
cannot initialize module ImportControl - illegal value
'<repo>/hudi-cli/style/import-control.xml' for property 'file'
The root pom expands checkstyle's ${basedir} to
${maven.multiModuleProjectDirectory}.
Maven derives that property by walking up from the working directory
looking for a
.mvn directory; with none in the repo it falls back to the directory Maven
was
invoked from, so a build started inside a submodule pointed basedir at that
submodule instead of the repo root.
Add an empty .mvn/extensions.xml so the directory exists, and narrow the
.gitignore
entry from .mvn/ to .mvn/* with a negation, keeping locally generated .mvn
content
(such as the maven wrapper) ignored.
Closes #15909
* fix(build): keep nested .mvn directories ignored so RAT still skips them
The first version of this change replaced the ".mvn/" ignore entry with
".mvn/*" plus a negation. A gitignore pattern containing a slash is anchored
to the file's directory, so ".mvn/*" only covers the repo-root .mvn, whereas
the original ".mvn/" matched a .mvn directory at any depth.
apache-rat 0.16 reads .gitignore, so narrowing the pattern also un-hid
hudi-trino/.mvn/modernizer/violations.xml and
violations-production-code-only.xml, which carry no ASF header. That is what
failed validate-source with "Too many files with unapproved license: 2".
Keep ".mvn/" for any depth, re-include only the repo-root directory, then
ignore its contents apart from extensions.xml. Verified against the source
release directory the CI job builds: RAT reports 0 unapproved files.
* docs(build): name apache-rat as the reason the .mvn ignore stays
un-anchored
Review feedback: the comment attributed the un-anchored entry to local build
output. The actual constraint is that apache-rat reads .gitignore, so
narrowing
the pattern un-hides hudi-trino/.mvn/modernizer/*.xml, which are tracked
without
ASF headers, and validate-source fails.
---
.gitignore | 10 ++++++++++
.mvn/extensions.xml | 32 ++++++++++++++++++++++++++++++++
2 files changed, 42 insertions(+)
diff --git a/.gitignore b/.gitignore
index 3b958a63ce16..f4850db9b2f5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,7 +3,17 @@
target/
metastore_db/
.metals/
+# Track the repo-root .mvn/extensions.xml: that directory must exist for
+# maven.multiModuleProjectDirectory to resolve to the repo root when a build
runs from inside a
+# submodule (HUDI-6111).
+# Keep the un-anchored `.mvn/` entry. A pattern containing a slash is anchored
to this file's
+# directory, so narrowing it to `.mvn/*` would stop matching nested .mvn
directories -- and
+# apache-rat reads .gitignore, so that un-hides
hudi-trino/.mvn/modernizer/*.xml, which are tracked
+# without ASF headers, and validate-source fails.
.mvn/
+!/.mvn/
+/.mvn/*
+!/.mvn/extensions.xml
*.bloop/
*.vscode/
*.metals/
diff --git a/.mvn/extensions.xml b/.mvn/extensions.xml
new file mode 100644
index 000000000000..33e5c6222346
--- /dev/null
+++ b/.mvn/extensions.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!--
+ This file intentionally declares no build extensions.
+
+ Its purpose is the presence of the `.mvn` directory itself: Maven walks up
from
+ the working directory looking for `.mvn` to decide
`maven.multiModuleProjectDirectory`.
+ Without it, that property resolves to whatever directory Maven was invoked
from, so
+ running a build inside a submodule (for example `cd hudi-cli && mvn
checkstyle:check`)
+ made the checkstyle `propertyExpansion` in the root pom point `basedir` at
the submodule
+ and checkstyle failed with "Unable to find:
<module>/style/import-control.xml".
+ See HUDI-6111.
+-->
+<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0
http://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
+</extensions>