Hi all,

I have a common need which is to "script in java".
We have three main options today: scripting plugin or exec plugin in our
ecosystem or java 25 (`java -cp .... myscript.java`).
This works great but needs a pom.xml almost for all options (or equivalent)
since you need to define your deps.

Side note: I exclude jbang which has no official editor support (for ex
extension is unsigned in vscode) and still needs --quiet by default to be
able to be used every time.

I wonder if we couldn't make maven support java files by default and kind
of directives as jbang to handle the classpath - maybe something closer to
what we do have in the polyglot extensions.

Where I'm mixed is that this is trivial to do everywhere - I would have
done it in exec to be honest - but requires to be in core to hope a global
OOTB editor support I think else it will fail with the dozen of similar
projects which work but lack completion until you run
"this-generates-project-metadata"....which kind of means just write a pom.

Final goal is to not have to materialize a pom to execute a java 25 script,
just to have the thin wrapper to handle the dependency resolution and exec
of java.

Do you think it is something which can finish in maven 4 next to the new
commands (enc, up etc)?

(side note: this thread is mainly to agree we get the feature in core to be
able to promote it as something not in an extension/plugin, the syntax
details would be in other threads)

Romain Manni-Bucau
@rmannibucau <https://x.com/rmannibucau> | .NET Blog
<https://dotnetbirdie.github.io/> | Blog <https://rmannibucau.github.io/> | Old
Blog <http://rmannibucau.wordpress.com> | Github
<https://github.com/rmannibucau> | LinkedIn
<https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/en-us/product/java-ee-8-high-performance-9781788473064>
Javaccino founder (Java/.NET service - contact via linkedin)

Reply via email to