Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

My problem with gradle is that its configuration language is a programming language.

Sounds amazing in practice. And it is. Until you need to fix a 3 year old build that has some insane wizardry going on.




> Until you need to fix a 3 year old build that has some insane wizardry going on.

My experience with Gradle is that it's the "3 year old build" that is almost certainly a death knell more than the insane wizardry part. My experience:

  git clone .../ancient-codebase.git
  cd ancient-codebase
  ./gradlew  # <-- oh, the wrapper, so it will download the version it wants, hazzah!
  for _ in $(seq 1 infinity); do echo gradle vomit you have to sift through; done
  echo 'BUILD FAILED' >&2
  exit 1
Contrast that with https://github.com/apache/maven-app-engine (just to pick on something sorted by earliest push date, some 10 years ago):

    $ git clone https://github.com/apache/maven-app-engine.git
    $ cd maven-app-engine
    $ mvn -B compile
    [INFO] -------------------------------------------------------------
    [ERROR] COMPILATION ERROR :
    [INFO] -------------------------------------------------------------
    [ERROR] error: Source option 6 is no longer supported. Use 8 or later.
    [ERROR] error: Target option 6 is no longer supported. Use 8 or later.
    [INFO] 2 errors
    
    $ echo "Java gonna Java"
    $ git grep -n source.*6
    pom.xml:133:            <source>1.6</source>
    $ sed -i.bak -e 's/1.6/1.8/g' pom.xml
    $ mvn -B compile
    [INFO] BUILD SUCCESS


I dislike Gradle as much as you probably do, but between Maven and Gradle, the one that "vomits" stuff on the command line is definitely Maven. Gradle errs by going too far to the other end: it just doesn't log anything at all, even the tasks that are actually being run (vs skipped... do you know how to get Gradle to show them?? It's `gradle --console=plain`, so obvious!! Why would anyone complain about that, right?!) or the print outs you add to the build to try to understand what the heck is going on.


Having worked with Maven and Gradle, I'd say Gradle was worse in the average case, but better in the worst case. There are way more Gradle projects with unnecessary custom build code because Gradle makes it easy to do.

On the other hand, when builds are specified in a limited-power build config language, like POM, then when someone needs to do something custom, they have to extend or modify the build tool itself, which in my experience causes way more pain than custom code in a build file. Custom logic in Maven means building and publishing an extension; it can't be local to the project. You may encounter projects that depend on extensions from long-lost open source projects, or long-lost internal projects. On one occasion, I was lucky to find a source jar for the extension in the Maven repository. It can be a nightmare.

The same could happen with Gradle, since a build can depend on arbitrary libraries, but I never saw it in the wild. People depended on major open-source extensions and added their own custom code inside the build.


> it can't be local to the project

It certainly can be, in the same repository.


When I used Maven, extensions had to be published to and pulled from a public repo. We couldn't even use the private repo that we used for the rest of our libraries, because the extension had to be loaded before Maven read the file where our private repo was configured.

Whereas a Gradle build can read Groovy files straight from disk.


> When I used Maven, extensions had to be published to and pulled from a public repo.

You can just `mvn install` them locally into your local repository.


Then you don't have a standard build, you have a build with multiple steps that needs to be documented and/or scripted. In an organization where every other project builds in a single step with "mvn package", and people can check out a repo and fire up their IDE and stuff just works, people are going to get bent out of shape because from their perspective, things aren't working out of the box.

A slightly more powerful build tool that supports custom code in the build doesn't force users to script around it. You can create an arbitrarily customized build that builds with the same commands as a Hello World project. (It's a double-edged sword, to be sure, because people don't try as hard to avoid customization as they would with Maven.)


You can, but why should you need to? Why can't the build tool take the plugin code directly off of disk, build it, and use it? This kind of orchestration of manual steps is what build tools are meant to be good at


Sure. But adding ability to self-modify the build drastically increases the complexity of a build tool. Maven developers decided that they want to avoid that.


It can, for plugins. GP is talking about extensions which you typically don't need.


I'm using several maven plugins (not extensions) that are defined within the reactor project itself. It works well.

You do need to split your build into multiple projects governed by a reactor but you'll have that anyway as soon as you have more than 1 module. Then you just always build the reactor. Pretty much the same idea as gradle.


As the most extreme counterexample of your ... experience[1], someone made a plugin that allowed writing pom files in languages other than XML: https://github.com/takari/polyglot-maven/tree/polyglot-0.7.2...

With an especial nod to https://github.com/takari/polyglot-maven/tree/polyglot-0.7.2... given this submission

1: I believe that you encountered errors, programming is packed to the gills with them, but correlation is not causation in that just because it did not immediately work in your setup does not mean it's impossible or forbidden


My problem with gradle is that they keep making breaking changes for low value things like naming of options, so I have to chase deprecation warnings, and can never rely on a distro supplied gradle version

Gradle devs, please get over yourself and stay backward compatible.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: