Skip to content

[SPARK-52652][BUILD] Replace os-maven-plugin with nisse#51350

Closed
pan3793 wants to merge 2 commits intoapache:masterfrom
pan3793:SPARK-52652
Closed

[SPARK-52652][BUILD] Replace os-maven-plugin with nisse#51350
pan3793 wants to merge 2 commits intoapache:masterfrom
pan3793:SPARK-52652

Conversation

@pan3793
Copy link
Copy Markdown
Member

@pan3793 pan3793 commented Jul 2, 2025

What changes were proposed in this pull request?

Nisse provides drop-in-replacement for discontinued OS Detector plugin, the former works for both Maven 3 and 4, but the latter does not work for upcoming Maven 4.

https://maven.apache.org/docs/4.0.0-rc-3/release-notes.html

the useful, but unmaintained, os-maven-plugin extension has been replaced with at nisse extension.

Why are the changes needed?

Prepare for Maven 4 support.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Pass GHA's Maven building.

Was this patch authored or co-authored using generative AI tooling?

No.

@dongjoon-hyun dongjoon-hyun changed the title [SPARK-52652][BUILD] Replace os-maven-plugin with nisse [SPARK-52652][BUILD] Replace os-maven-plugin with nisse Jul 2, 2025
~ limitations under the License.
-->
<extensions>
<extension>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use 2-space indentation in pom.xml file.

Copy link
Copy Markdown
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM (except one comment about indentation).

@dongjoon-hyun
Copy link
Copy Markdown
Member

Merged to master. Thank you, @pan3793 .

@LuciferYang
Copy link
Copy Markdown
Contributor

late LGTM

@pan3793 pan3793 deleted the SPARK-52652 branch July 22, 2025 13:32
pan3793 pushed a commit that referenced this pull request Mar 25, 2026
### What changes were proposed in this pull request?
1. Use [Nisse](https://github.com/maveniverse/nisse) as plugin instead of extension, to make IntelliJ's importer work
2. Bump Nisse to its latest 0.7.0, from 0.4.6

### Why are the changes needed?
Nisse is introduced by [SPARK-52652](#51350) to replace unmaintained os-maven-plugin, in which Nisse is used as extension.

Maven CLI works correctly with that change, but it seems IntelliJ has something wrong: some functions provided by Maven tool window (using so-called `IDE Maven importer`) has warnings or fails eventually. For example:
- `Sync/Reload All Maven Projects`: succeed but with a lot of warnings `[WARNING] NisseModelVersionProcessor.overwriteModelProperties: failed, called out of session?`, which indicates Nisse as os-detector performs "illegal" action of modifying the read-only session.
- `Generate Sources and Update Folders For All Projects`: fail with some artifacts being missing. And it is due to `os.detected.classifier` is not correctly interpolated. Nisse is in charge of that.

The re-producing steps are recorded in [a Nisse issue](maveniverse/nisse#138 (comment)).

As the PR proposed, instead of extension, Nisse is changed to be used as plugin, and it makes both Maven CLI and IntelliJ work (no warning and code is generated correctly).
Being used as plugin provides limited functions (only to provide properties for interpolation within a project), when [comparing to being used as extension](maveniverse/nisse#138 (comment)). But luckily, it is enough here.

[IDEA-386604](https://youtrack.jetbrains.com/issue/IDEA-386604/Maven-plugin-does-not-work-with-Nisse-used-an-extension) is also filed to JetBrains, and it appears to me that the `IDE Maven importer` provided by IntelliJ's [Maven plugin (and its Maven tool window)](https://plugins.jetbrains.com/plugin/27164-maven) works differently from Maven CLI, or even has something wrong when working with Nisse as extension. And since the issue is being processed somehow slowly, it might be better to make it work in Spark project firstly, while I will continue to watch that issue and probably change it back if there is a fix in IntelliJ.

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
- CLI
  - `build/mvn -Phive -Phive-thriftserver -Pyarn -DskipTests clean install`
  - `build/sbt -Phive -Phive-thriftserver -Pyarn clean compile package` (SBT were also tested although I do not think it is quite related to this fix)
- IDE IntelliJ
  - `Sync/Reload All Maven Projects` and `Generate Sources and Update Folders For All Projects` in IntelliJ's Maven tool window

### Was this patch authored or co-authored using generative AI tooling?
No.

### Declaration
The proposal is originally provided by [cstamas](https://github.com/cstamas). It is my honor to [have his agreement](maveniverse/nisse#138 (comment)) to consolidate and share it in Spark.

Closes #54825 from waterlx/nisse.

Authored-by: Xiang LI <waterlx@gmail.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants