3 ms·
When coding in Java, I usually start with a shell script that compiles the code rather than, say, a POM or a Gradle build - I don't upgrade to a dedicated build
by commandlinefan 6y ago
When coding in Java, I usually start with a shell script that compiles the code rather than, say, a POM or a Gradle build - I don't upgrade to a dedicated build system until a) the shell script becomes more trouble than it's worth or b) I have to share with somebody else. There's something to be said for having complete control over every aspect of the build.
- augusto-moura 6y agoI find Gradle pretty straightforward when it comes to compiling Java projects, you can customize and add options even dynamically like a shell script
- lmm 6y agoI disagree. Having complete control just gives you the chance to micromanage build steps and get bogged down in the details. I start with the most minimal POM possible - just listing dependencies - and firmly resist any custom build steps or even custom configuration. That way everything is standard, my build will be cross-platform and IDE-agnostic, and anyone else who picks up the codebase can immediately understand the build and be productive. If I absolutely need some custom build step, then I'll go all the way to making a proper, first-class maven plugin. I'll write it in proper production-quality Java with unit tests, code coverage and all the rest of it. IMO customising build steps in a scripting language (whether that's shell, Gradle, or even something like Python) is exactly the middle ground that you want to avoid. You can waste lots of time fiddling with how your build is structured, and it's still going to be less maintainable.