Maven is great when all you want to do is build a simple Java project and publish it, when you step outside of that it becomes much more painful.
For example, here's an old plugin I put together to allow easy publishing of a third-party artefact to a repository that didn't have a web interface for such things: https://github.com/andrewaylett/prepackaged
It's old enough that the infrastructure I set up around it has bit-rotted -- I've just pushed a clone to GitHub to share here :). I'd hope using modern language features would make it easier still.
Doing such prototyping in Maven is quite arduous in comparison.
Gradle _almost_ does the same, but it allows execution of arbitrary code in too many places -- like with parsing Perl, we can't discover the model without also executing it. Hence the trap.
[1] https://melix.github.io/blog/2021/01/the-problem-with-gradle...