Spring-Boot / Groovy / Gradle “Hello World” application

The complete code for this project can be found here:
https://github.com/mtrojahn/spring-boot-groovy-console-app

Last weekend I was playing around with Gradle which I have never used before. The result is this very basic spring-boot project just to illustrate how I did it. Gradle isn’t that difficult but I had a few problems until I learn about the spring-boot-gradle-plugin and such.

This is the build.gradle:

As you can see it’s fairly simple and way more organized than Maven in my opinion. The spring-boot-gradle-plugin is the key here. It provides all the version information for the dependencies and also adds a Gradle task “bootRun” which you can use to run your project.

Now we just need a main class:

Not that different from Java, right?

I’m a complete newbie on Gradle and Groovy but I really liked what I saw so far… If I made some mistake please leave a comment.

See ya!

You may also like...

Leave a Reply

%d bloggers like this: