Getting started as a programmer with your first Java Spring/Quarkus application can always be a daunting experience. Luckily, there are a lot of tools plugins, and libraries that can make our lives a bit easier.
In this article, I’d like to touch upon some of the tools, plugins, and libraries for Java Spring/Quarkus development and briefly explain what they are.
Tools
The proper tools can aid you in learning specific standards/setting up your first projects/automating tasks/etc.
SDKMan!
When you want to start developing your Java applications, you’ll need to have a Java Development Kit (JDK) installed. While you can download any openJDK such as Adoptium, I recommend using SDKMan! as it easily allows you to have multiple versions installed next to each other (which is nice when one wants to experiment) and also allows you to install other tools.
JetBrains Toolbox & IntelliJ CE
https://www.jetbrains.com/toolbox-app/
A good Integrated Development Environment (IDE) can immediately set you on the right track. My preferred free, feature-rich one is IntelliJ Community Edition. It offers a lot of advice and quality-of-life functionality when setting up your application.
The toolbox allows you to easily keep your IDEs up to date, and to have multiple versions installed. (I like using the early access builds to try out the new features)
logic) like Spring Boot to your application or set up how you want to build your code.
While you can certainly do a lot through your IDE, or using the Java compiler, sooner or later some tooling comes in handy. Currently, Maven and Gradle are the 2 most popular build tools.
Git
Once you’ve started writing your source code, it quickly becomes interesting to start doing some form of version control. This way it becomes easy to manage your code (and potentially revert to an earlier version of it in case you do run into an issue), and it facilitates collaboration with other developers.
You can use Git locally, but it’s quite useful to register a free account on GitHub or GitLab so you can push your code to a central place, from which you (or others) can easily fetch the code.
A good IDE will easily allow you to perform most versioning-related actions, but some may prefer using the command line.
GitHub Desktop/Sourcetree/GitKraken/TortoiseGit
When you’re just getting started with source control (which nowadays you’ll most likely do using Git) a nice user interface will make this a much smoother experience. For example: if you want to see what’s happening with your branches, want to see what you still need to commit, perform merges in case both your local and remote code has changed, …
I do recommend learning the commands further down the line, but there’s certainly nothing wrong with using these tools!
Spring Initializr / Code Quarkus app
Setting up your build can be a daunting challenge, luckily both Spring and Quarkus offer a setup site. These allow you to select your preferred build tool, which functionality you want, and pass in your application’s artefact ID and group to quickly bootstrap your application.
Spring Boot CLI / Quarkus CLI
In case, you’re more at him in your terminal or want to script your generation both Spring and Quarkus also offer a CLI tool.
JBang
Sometimes you want to quickly prototype something or run a simple Java file. While JShell and the new multifile launch (Java 22) do help quite a bit, you will still run into challenges when you need to add dependencies.
That’s where a tool like JBang comes in handy (which will even take care of downloading Java for you if it’s not installed!).
JHipster
In case you’re interested in quickly generating a Spring boot & Angular/React/Vue project, JHipster has you covered! It’s a free and open-source application generator that will have you up and running in no time!
Their documentation is magnificent, and Matt Raible wrote a useful mini-book:
Just answer a few questions and your basic project will be generated for you!
Docker
Docker allows us to manage (start/stop/download/…) so-called containers which are lightweight, portable & self-contained units that package application(s) and everything needed to run them. For example, rather than the “classical” installation of say MySQL, we could instead of the official MySQL docker image. We can even create custom images with their own configuration.
Using this approach means we have a much more repeatable approach, that can easily be shared with others and can easily be added/removed. Rather than the more cumbersome approach of (un)installing.
Testcontainers Desktop
Over the past few years, Testcontainers (a library that simplifies integration testing by providing easy-to-use, lightweight containers for databases, message queues, …) have become a lot more popular.
This free-to-use application simplifies the management thereof. It gives us increased insights into what’s happening in our test sessions, integrates with their cloud offering, enable reusable containers, …
OpenRewrite/Moderne
https://github.com/OIdriss/springbootdc/blob/main/main/java/org/example/webshop2/user/UserDTO.java
I’ll admit, this one is a bit of an odd one out, especially for a more beginner-oriented article.
OpenRewrite, and Moderne(the paid, but free for open-source projects platform) enable mass-scale refactorings of applications.
Now when you’re writing your first projects this isn’t too relevant yet, but as some of your sample projects age, it might be interesting to have them automatically (to the degree possible) upgraded to the latest version.
This might also be quite interesting if you’ve received some older sample code, and want to see what it would look like nowadays. For example, to refactor some Java 8 code, to make use of some best practices and new features from Java 21 you merely need to do:
mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:RELEASE -Drewrite.activeRecipes=org.openrewrite.java.migrate.UpgradeToJava21
Gatling
Gatling’s a great application for performance, and load testing of your application. It can be run both locally, and in the cloud. Load testing itself is quite important, as you do want to ascertain how well your application behaves when under load, and if there are any concurrency issues.
If you’re interested in more details, you can read my previous article Load Testing: Shoot Your Application With Gatling.
Java Microbenchmark Harness (JMH)
At times you might have some performance concerns for a specific functionality, and that’s where the JMH comes in handy!
It allows us to measure:
- average time per operation
- sample time for each operation
- operations per unit of time
- the time for a single operation
After all: “Measure twice, cut once.”. It’s always best to get a good baseline and idea of where the perceived bottleneck is.
VisualVM
When we want to monitor/troubleshoot/profile applications running on the Java Virtual Machine (JVM) VisualVM comes in handy. It offers us a visual representation of the CPU, memory, thread and class usage. Easily allowing us to gather better insights.
Java Flight Recorder (JFR)
JFR is a profiling/event collection framework that’s built into the JDK that allows us to gather so-called events (blocked thread, the health of the system, usage of deprecated methods, custom events, …) during a time-fixed (also known as a profiling recording), or as a continuous recording.
Digma Continuous Feedback (CF)
https://plugins.jetbrains.com/plugin/19470-digma-continuous-feedback
When we get started with writing our first application (Hello World!), we’re already happy that it runs as expected. But as our applications become more complex, the importance of knowing what’s happening behind the scenes, and gathering insights into what’s potentially slowing us down becomes increasingly important.
This is where the OpenTelemetry standard comes into play when we want to go beyond logging.
OpenTelemetry is an open source, Cloud Native Computing Foundation incubating project that collects APIs, SDKs, and tools to help us observe what’s going on in our application, and to collect/export this data so that we can act upon it.
Digma itself is a tool that helps developers interpret, and act upon this data all from the convenience of our IDE to reduce the abstraction layer.
It also provides some automated insights such as suspected N+1.
The Digma blog also has a nice post about improving your code design using observability.
IDE Plugins
Your favourite IDE, be it Visual Studio Code, VIM, or IntelliJ, … likely has a lot of plugins that can smoothen out your workflow.
Here are a couple of plugins that I use daily:
- rainbow brackets: it makes it a lot clearer where your brackets start/end
- .env files support: simplifies environment variable management for run/debug configurations, with syntax highlighting
- translation: integrates a lot of translation engines making it easier to localize your comments/properties.
- String manipulation: as the name implies, it offers a lot of text manipulation options such as case alterations
- JPA Buddy: this plugin lowers the barrier when working with JPA, Lombok, MapStruct, …
- Key Promoter X: to speed up your development speed it’s useful to learn the shortcuts for frequent actions, this is a tool that shows you the missed shortcut & how often you’ve missed it
- Digma: the IntelliJ plugin for the tool mentioned earlier
For more interesting plugins, I can recommend the blog post by Lee Sheinberg: 25 Best IntelliJ IDEA Plugins for Developers in 2023
Libraries
There are a lot of Micronaut/Quarkus/Spring/… specific libraries that are worth diving into, and they’re certainly worth an article of their own. But when you’re starting, I generally recommend following their documentation which generally introduces you to the specific ones (such as Spring Security, Panache, …)
Thus let’s take a look at some of the more useful, framework-agnostic ones.
- Apache POI: in case you need to interact with files based on OOXML such as Word files
- Apache PDFBox: create & change PDF files, or extract their content
- ArchUnit: a way to verify, and safeguard your code’s architecture (this is a more detailed article)
- AssertJ: one of the most popular libraries for writing fluent assertions
- Awaitility: a magnificent library for when you want to test asynchronous operations
- caffeine/ehcache: high-performance caching libraries
- DataFaker: a library that helps you generate good fake data for your tests, which otherwise can be a laborious process
- iText: a very useful, expansive library to create PDFs (do make sure to use the correct version!)
- Jackson: a high-performance JSON processor
- JaCoCo: free Java Code Coverage library. Helpful to keep track of how well you’re doing testing-wise
- JobRunr: a distributed job scheduler
- JUnit: one of the most popular unit testing frameworks
- Liquibase/Flyway: database migration management library. It helps you incrementally update your database model
- MapStruct: a bean code mapping generator. These libraries have their (dis)advantages, but this is one of the most commonly used ones
- Playwright: end-to-end testing library for your applications
- ShedLock: when you need distributed schedule locking
- Testcontainers: lightweight manner to manage containers. For example use a real DB container, rather than H2!
- Togglz: manage feature flags for your application in a convenient manner
- WireMock: a tool for building mock APIs, very useful when you’re dependent on unstable APIs during your development process
Editor’s note: 44 Tools, plugins and libraries for Java Spring/Quarkus development
This is by no means an exhaustive list of tools, plugins, and libraries to get started with your first Java Spring/Quarkus app, but hopefully, these items will help you get started. Please feel free to reach out if I missed something essential, and enjoy the journey!
This article was contributed to the Digma blog by Simon Verhoeven, a Senior Software Engineer and Java Consultant with a particular focus on Cloud quality and Maintainability.
Install Digma: Here
Very solid post. Thank you for sharing it. We also write about DevOps, you can check out one of our articles here https://www.metridev.com/metrics/cycle-time-vs-flow-time-decoding-the-metrics/