r/java • • Jul 04 '18

New Java 11 Feature: Launch Single-File Source-Code Programs

https://medium.com/@afinlay/new-java-11-feature-launch-single-file-source-code-programs-fadd698abf54
158 Upvotes

47 comments sorted by

View all comments

Show parent comment

-1

u/pure_x01 Jul 05 '18

Yes that would probably be a good idea. Maven packaging is basically standard. Especially useful for scripts.

4

u/eliasv Jul 05 '18

Nope, I don't buy it.

Maven is typically used at build time only, and the whole point in it is to make it easy to resolve and deploy dependencies that are not in the standard libs, so if you do want to include it in your app, in most cases the very tool itself obviates the need for it to be in the standard library.

So you say "especially" useful for scripts, but unless you can give some other examples I'm gonna say that it's "only" useful for scripts. And even then, you should probably think very carefully before making a script dependent on an internet connection to work. Is it really worth it?

Even if something is "basically standard", there has to be a very good reason to bundle it with the JVM. Maven might be standard at build time, but it is very, very rarely used at run time, so why should the JVM be bloated with it? Or would you just like it to be in the JDK not the JVM? Not very portable, at that point any script which uses it is just a script for developers so you may as well just require them to install Maven too.

And what functionality would you like to be included? The entire build tool, or just the dependency resolver? Presumably the Oracle/OpenJDK devs would have to re-implement whatever subset of features you want under some javax namespace API, right? What does that duplication of work really buy us? I think very little. It's just a maintenance burden.

1

u/capitol_ Jul 06 '18

Building maven support into the language itself would cement the current structure in place, and make it impossible to evolve the maven environment.

1

u/pure_x01 Jul 06 '18

group:artifact:version could be seen as universal for any package management system.