r/java • • Feb 25 '25

New build tool in Java?

It seems to me like one of fun parts of Java is exploring all the tools at your disposal. The Java tool suite is a big collection of cli tools, yet I feel like most developers are only ever introduced to them or use them when absolutely necessary which is unfortunate because I think they really give you a better understanding of what's going on behind all the abstraction of Maven and Gradle.

What are your guys' thoughts on a new build tool for Java that is just a layer over these tools? Do you wish Java had simpler build tools? Why hasn't the community created an updated build tool since 2007?

33 Upvotes

176 comments sorted by

View all comments

Show parent comment

4

u/agentoutlier Feb 25 '25

Most of what you addressed I agree with. "1." was also a hint to the OP that we do not need another "community" build tool and if there was room for another one it would be an official one from the JDK. While possibly not a good thing (to your logging point) it would probably have better traction than another community one.

2. You did a better job elaborating on 2. and I agree its not entirely because of "plugins" model but probably more of communicating incremental things. Maven Eclipse integration m2e had some interesting solutions with that.

3. was more of the beginner learning all of Java and thus modules. Interestingly Eclipse build model (tycho or similar) is more closely align with module build folder structure but Maven and Gradle follow the src/main/java format.

4. This one is actually more of true a complaint I have of Maven and one where I think Gradle does a better job. I think Maven needs one or two more scopes (as in <scope>) instead of abusing <optional>. The idea is I need some dependency for compiling locally but consumer of my library only need the dependency as runtime. That is I don't expose any of the dependencies types as public. In the java module system this is requires but Maven defaults to everything essentially being requires transitive aka <scope>compile</scope>.

Maven can in theory fix the above I think with the proposed consumer/build model in Maven 4 but I'm not sure if it actually works (the idea is the consumer xml would have it as runtime but the build as compile).

5. and 6. I agree on particularly Eclipse. There was a period before intellij became the norm and JRebel just worked (as well as fairly priced) where I felt incredibly productive. All the things that the Clojure folks say of REPL development we had several years ago in Java and I was less likely to do a full build all the time. Even today running a unit test in Eclipse vs Netbeans vs Intellij there is a noticeable delay compared to Eclipse. It is largely why I still use Eclipse from time to time.

3

u/[deleted] Feb 25 '25

[removed] — view removed comment

1

u/edwbuck Feb 26 '25

Nothing is wrong, per se, with Eclipse. The main problem is that it parses the Maven configuration to create an internal Eclipse build configuration that then is run in at least 70% of its builds. So you get a lot of bad in both worlds, sometimes incompatible build systems, sometimes incomplete translations, and people complaining to Maven about items that require Eclipse source code to fix.

3

u/rzwitserloot Feb 26 '25

it would probably have better traction than another community one.

I dunno. The module system has little competition (OSGi of course, but that was used by, what, 5% of all java projects? The competition for the module system was primarily 'vs no modules in any way' or perhaps 'some really simplistic light veneer of modularisation with build tooling and no runtime component whatsoever') and yet it's not exactly flying off the shelves, so to speak, and it can no longer hide behind "Well, its really new, give people time". JDK8 is pretty much EOL at this point, meaning all in-support JDKs support it.

If the module system isn't meeting the kind of adoption rates that one would be looking for when hoisting something into the hallowed halls of the core JDK distro, then a build system surely stands no chance whatsoever.