Git still can’t properly merge moved folders

You’d think after all these years Git would be able to do such a basic thing, right? In my branch I reorganize the project structure, in his branch the teammate does further development, and two days later we merge our work and go for a beer?

Continue reading

HTTPS with mutual authentication

If you want to secure your existing Tomcat server or don’t use Spring Boot there’s quite a lack of up-to-date configuration information, especially because all existing examples were made invalid by the arrival of Tomcat 10 (yes it already happened).

So because I needed a future proof SSL configuration that is also understandable to the security beginner (also me), here’s what I come up with:

Continue reading

Lessons learned after losing the Terraform state file

Terraform is a infrastructure-as-code (IaC) tool where you describe the desired pieces of infrastructure you need in some config files, then Terraform will create the infrastructure in your cloud provider of choice. Or delete them, or modify them – because Terraform compares the cloud infrastructure state with the expected one. And the expected state is kept in… a state file, right. So if the state file gets lost, Terraform will think it never created those resources in the first place and will try to duplicate everything. Do you see the problem here? Not only your infrastructure will cost double, but you’ll get also all kind of nasty overlappings and cross-pollination between previous and fresh resources and versions. We definitely don’t want that.

Continue reading

Reading in from CSV numbers into strings with Jackson

Reading data from CSV, nothing simpler in Java with all those Jackson tutorials out there. Unless you want to read everything as string, that is. CsvMapper will take anything looking like a number and try to map it into some Integer or whatever, and if you needed strings in that field, well, too bad. Crash.

Continue reading

Building Quarkus native images. You can do it too!

If you read the Quarkus native build page, it should be a breeze: enable -Pnative and there we go! Well… not so fast. Not so fast at all, as they recognize in another “Quarkus native tips” page, unfortunately not linked from the first one (so good luck googling for it). And boy do you need those tips…

I had this application happily running for months and while at the beginning there were some recognized issues with native generation on Windows, nowadays the general expectation was it should work. So I updated all dependencies and started a painful three days long trip, but hey no pain no gain right?

Here’s what it required:

Continue reading