Archive: January 2020

Groovy Goodness: Transform Elements While Flattening

Posted on by  
Hubert Klein Ikkink

We can use the flatten method in Groovy to flatten a collection that contains other collections into a single collection with all elements. We can pass a closure as extra argument to the flatten method to transform each element that is flattened. The argument of the closure is the element from the original collection.

In the following example we first use the flatten method without a closure argument. Then we pass a closure argument and transform the element:

Continue reading →

Deploying a properties file next to your jar on OpenShift

Posted on by  
Sjoerd During

I’ve recently had the situation where I deployed a Spring Boot application on OpenShift where a certain dependency needed a properties file that couldn’t be found. The problem was that this dependency didn’t scan the classpath for the file, but just opened a FileInputStream relative to the current path.

In this blogpost I will guide you through the process of deploying a text file next to a jar in an OpenShift container. I’ve reproduced an example scenario, but you can skip these steps and go right to the solution if you want to.

Continue reading →

shadow-left