GroovyBlogs.org
Groovy 4.0: These 10 New Features Make It AWESOME! | Mark As Read |
Switch Expression Groovy has always had much more powerful switch statements compared to Java. Class case values, regular expression case values, collection case values, closure case values, or at th...
Groovy Goodness: Using Macros For Getting More Information About Variables | Mark As Read |
In a previous post we learned about the macros SV, SVI and SVD that return a string representation of variables with their name and value. Groovy 4 also added the NP and NPL macros that we can use to ...
Groovy Goodness: Using Macros For Getting String Representation Of Variables | Mark As Read |
Groovy 4 added some built-in macros that we can use in our code. A macro is code that will create new code. It does this by manipulating the Abstract Syntax Tree (AST) before the code is compiled. So ...
Gradle Tutorial: Crash Course [Video] | Mark As Read |
Ever looked for a comprehensive tutorial for Gradle that is fun and entertaining at the same time? In this video tutorial below, you'll learn how to use Gradle like a professional. Cover topics i...
Groovy Goodness: Closed And Open Ranges | Mark As Read |
Groovy supports ranges for a long time. But Groovy 4 adds a new feature for ranges and that is the support for open (exclusive) ranges at the beginning of a range. Open means the number that defines t...
Get Absolute Path To An SDK With SDKMAN! | Mark As Read |
SDKMAN! has a home command that will return the absolute path of any SDK we pass as argument. This can be usefull in scripts where we need the absolute path to a SDK. We can specify the name of the SD...
Groovy Goodness: Creating TOML Configuration With TomlBuilder | Mark As Read |
Groovy 4 introduced support for TOML configuration file. In a previous post we already learned how we can parse TOML content. In this post we will see we can use a builder syntax to create TOML conten...
Groovy Goodness: Reading TOML Configuration | Mark As Read |
Since Groovy 4 we can parse TOML configuration data into a Map. Once the TOML data is transformed into the Map we can use all possibilities in Groovy to lookup keys and their values in maps. For examp...
Groovy Goodness: Get Row Number In GINQ Result Set | Mark As Read |
GINQ (Groovy-INtegrated Query) is added since Groovy 4. With GINQ we can query in-memory collections with SQL like statements. If we want to get the row numbers for each row in the query result set we...
Groovy Goodness: Using The Switch Expression | Mark As Read |
In a previous (old) post we learned how Groovy supports different classifiers for a switch case statement. Since Groovy 4 we can use switch also as an expression. This means the switch statement retur...
DataWeave Delight: Check Type Of Value | Mark As Read |
To check if a value is of a certain type in DataWeave we must use the is operator. We must specify the type after the is operator and the value before the is operator. For example to check if the valu...
Better Scaffolding with jQuery - Part I | Mark As Read |
Grails scaffolding works great out of the box. Today I want to see how we can improve adding data to the many side of a one-to-many relationship using jQuery, jQueryUI's Dialog, and some Ajax. &...
Maven - finer control of running tests . . . | Mark As Read |
There should always be something new to learn everyday. Otherwise, life is boring. In software development, it is even more boring if we don't explore to learn anything new.Maven is popular open sourc...
JUnit 5 Tutorial: Nice and Easy [Video] | Mark As Read |
Ever looked for a comprehensive intro to JUnit 5 that is fun and entertaining at the same time? Then have a look at this brand-new episode of the "Marco Codes" YouTube channel: JUnit 5 Tutorial - Nice...
Maven - running Java app . . . | Mark As Read |
When Maven is the build tool and you have no choice, you need to factor in additional amount of development time dealing with its build file: the pom.xml. Any new additional feature eats up unexpected...
Get Started With Reactive Programming With Kotlin on Quarkus | Mark As Read |
Moving to the cloud with event-driven architecture raises big concerns for enterprises using multiple programming languages such as Java, C#, JavaScript, Scala, and Groovy to implement business requir...
DataWeave Delight: Counting items in array with predicate | Mark As Read |
The dw::core::Arrays module has some nice functions that works with arrays. One of these functions is countBy. The function takes an array as first argument and a predicate function that accepts an it...
DataWeave Delight: Finding highest or lowest value in an array | Mark As Read |
DataWeave has several function to find the highest or lowest value in an array. The items in the array need to be of the same type and implement the Comparable interface. To find the highest value we ...
Containerize Gradle Apps and Deploy to Kubernetes With JKube Kubernetes Gradle Plugin | Mark As Read |
This article is a follow-up to my previous post, Deploy Maven Apps to Kubernetes With JKube Kubernetes Maven Plugin. Eclipse JKube is a collection of tools and libraries which ease a Java developer's ...
How To Detect and Secure Your Java App From Log4j Vulnerabilities | Mark As Read |
Apache Log4j is the popular open source logging library for Java developers that was recently caught up in a massive security-related breach. Due to its popularity, a large number of organizations wer...
Spring Boot Groovy Console | Mark As Read |
Observability is a must-have nowadays in modern cloud services. There are multiple levels and options to provide observability into a service. Logging is the basic one but is well used can perform... ...
Spocklight: Adjusting Time With MutableClock | Mark As Read |
Testing classes that work with date calculations based on the current date and time (now) can be difficult. First of all we must make sure our class under test accepts a java.time.Clock instance. This...
I still love Groovy . . . | Mark As Read |
I was joyfully coding in Groovy for several years. Back to Java two years ago, and have not been writing any production code in Groovy, still writing my own productive non-production utilities in...
Running a Micronaut Service in Docker | Mark As Read |
Micronaut is a state-of-the-art micro web framework targeting the Java Virtual Machine (JVM). I quite like that you can implement your web application oder service using either Java, Groovy or Kotlin ...
Maven - multi-module Java project code coverage . . . | Mark As Read |
In addition to developing, building & deploying modern Java applications is also a developers' concern. Build tools come with a promise to save developers' time. But often times they suck develope...
Learn Quarkus faster with quick starts in the Developer Sandbox for Red Hat OpenShift | Mark As Read |
Java developers are usually required to take many actions before we can begin developing and deploying cloud-native microservices on Kubernetes. First, we have to configure everything from the integra...
How to Import the Gradle Spring Boot Application in Eclipse? | Spring Boot Tutorial [Video] | Mark As Read |
In the video below, we take a closer look at the How to import the Gradle spring boot Application in eclipse? | Spring Boot tutorial. Let's get started!
How to Install Gradle in Windows OS | Gradle Tutorial [Video] | Mark As Read |
In the video below, we take a closer look at the How to install Gradle in the windows operating system? | Gradle tutorial. Let's get started!
How to Bootstrap a Spring Boot App | Mark As Read |
In the video below, we take a closer look at how to bootstrap a Spring Boot application with some help from Gradle. Let's get started!
Java Joy: Getting Multiple Results From One Stream With Teeing Collector | Mark As Read |
If we want to get two types of information from a Stream of objects we can consume the Stream twice and collect the results. But that is not very efficient, especially when the stream has a lot of obj...
Gradle Goodness: Create Properties File With WriteProperties Task | Mark As Read |
If we need to create a Java properties file in our build we could create a custom task and use the Properties class to store a file with properties. Instead of writing our custom task we can use the t...
Handling Events With GServlet | Mark As Read |
Introduction In my previous article, Creating Filters With GServlet, we learned how to create filters with the GServlet API for an elegant implementation with the Groovy language. In this one, we are ...
Gradle Goodness: Add Support For "Scratch" Files To Java Project | Mark As Read |
When working on a Java project, we might want to have a place where we can just play around with the code we write. We need a "scratch" file where we can access the Java classes we write in our main s...
Gradle Goodness: Enabling Preview Features For Java | Mark As Read |
Java introduced preview features in the language since Java 12. This features can be tried out by developers, but are still subject to change and can even be removed in a next release. By default the ...
Re-Thinking the Visitor Pattern With Scala: Shapeless and Polymorphic Functions | Mark As Read |
Over the course of my career, a problem that I have had to face fairly repeatedly is dealing with a nested tree-like structure with arbitrary depth. From XML to directory structures to building data m...
Automatic Autonomous Wallet Download & Configuration with Micronaut | Mark As Read |
<p>Back in September, we <a href="https://recursive.codes/p/announcing-the-micronaut-oracle-cl oud-module-for-simple-sdk-integration-and-performant-serverless-functi ons">announc...
Creating Filters With GServlet | Mark As Read |
In my first article "Getting Started with GServlet", we created a simple Hello World Servlet using the Groovy language. Today, we are going to see how simple it is to create filters with the GServlet ...
Java Joy: Merge Maps Using Stream API | Mark As Read |
In Java we can merge a key/value pair into a Map with the merge method. The first parameter is the key, the second the value and the third parameter of the merge method is a remapping function that is...
Clojure Goodness: Merge Maps With Function To Set Value Duplicate Keys | Mark As Read |
In Clojure we can use the merge function to merge multiple maps into a single map. If a key is in multiple maps the value of the key merged last will be used in the resulting map. If we want to influe...
Gradle Goodness: Setting Plugin Version From Property In Plugins Section | Mark As Read |
The plugins section in our Gradle build files can be used to define Gradle plugins we want to use. Gradle can optimize the build process if we use plugins {...} in our build scripts, so it is a good i...
Gradle Goodness: Shared Configuration With Conventions Plugin | Mark As Read |
When we have a multi-module project in Gradle we sometimes want to have dependencies, task configuration and other settings shared between the multiple modules. We can use the subprojects or allprojec...
Getting Started With GServlet | Mark As Read |
GServlet is an open-source project inspired by Groovlets, which aims to use the Groovy language and its provided modules to simplify Servlet API web development. Groovlets are Groovy scripts exec...
Clojure Goodness: Remove Duplicates From A Collection With distinct | Mark As Read |
With the function distinct we can remove duplicate elements from a collection. The function returns a lazy sequence when we use a collection argument. Without arguments the function returns a transduc...
Java Code Quality Tools Recommended by Developers | Mark As Read |
The best way to protect your Java code from avoidable bugs is to use static code analysis tools that can help you find and fix problematic code before it reaches production. Let's look at some popular...
Clojure Goodness: Remove Consecutive Duplicate Elements From Collection | Mark As Read |
The Clojure core namespace contains many functions. One of the functions is the dedupe function. This function can remove consecutive duplicates from a collection and returns a lazy sequence where onl...
Treemap Diagram in Java Swing | Mark As Read |
In this tutorial, we will build a TreeMap diagram using the MindFusion diagramming library for Java and using IntelliJ as the development IDE. I. General Setup With Gradle and Maven We create a new Gr...
Clojure Goodness: Invoke Java Method With Varargs Parameter | Mark As Read |
Sometimes we want to invoke Java methods from our Clojure code. If the Java method accepts a variable arguments (varargs) parameter and we want to invoke the method from Clojure we must pass an array ...
Java Syntax Puzzlers | Mark As Read |
Roughly 12 years ago, I started to contribute to the Eclipse ecosystem in various functions. One of the most interesting experiences to this date was to work on developer tooling and handling the edge...
Message Driven Microservices & Monoliths with Micronaut - Part 2: Consuming Messages | Mark As Read |
<p>In our <a href="https://recursive.codes/p/message-driven-microservices-monol iths-with-micronaut-part-1:-installing-kafka-sending-your-first-messag e">last post</a>, w...
Upgrading a Maven, Spring Boot, and JavaFX Application | Mark As Read |
I've been migrating all my JavaFX applications to Java 15/JavaFX 15.0.1 to see if there are any pain points or gotchas to be aware of. I particularly wanted to understand how Maven and Gradle handl...
- Welcome!
- OnlyJava aggregates blogs for the Java industry.
- Custom Feeds
- Add any RSS feed to the information you read daily.
- Blocked Feeds
- Block feeds to remove blogs you’re not interested in.
- Account Settings
- Customize the site by adding or removing feeds.
Don’t have an account yet?
- Customize your settings
- Edit how your blog displays
- Add or remove blogs you read. Sign Up.
About Us
OnlyJava is your source for all your Java news.
Know of a Java blog that we're missing? Let us know! |