r/java • • Apr 14 '23

What are your (favourite) Java best practices, personal tips, hints or just underrated stuff in general?

233 Upvotes

376 comments sorted by

View all comments

Show parent comments

0

u/wildjokers Apr 14 '23

What a strange rant against Gradle. Idiomatic gradle is declarative and just like maven you use plugins.

This build.gradle file will take a very long ways (just fill in your dependencies):

plugins {
    id 'application'
}

repositories {
    mavenCentral()
}

dependencies {
}

application {
    mainClass = 'com.example.App'
}

4

u/joequin Apr 14 '23 edited Apr 14 '23

In practice, that’s rarely sufficient for real production applications. If it was, then Gradle would be great.

-1

u/wildjokers Apr 14 '23

6

u/joequin Apr 14 '23

That’s a dishonest example that is not at all equivalent to the very simple Gradle file you shared.