I really like maven for the structured way it provides for defining and building a project. But sometimes I wish for a less verbose notation than the XML of the Project Object Model (POM). For example, gradles dependency notation is far shorter than mavens dependency declaration. Looking for a less verbose way to declare a maven POM, I discovered polyglot maven. It are maven extensions that allow the maven POM to eb written in another dialect than XML. Since you see YAML more and more I decided to try that dialect, and see if my maven descriptor would be clearer.
-
Create a directory to work in, {projectdir}
, and change into it.
-
To register the extensions for maven, create a file {projectdir}/.mvn/extensions.xml
and add the extension:
-
Now it’s possile to write the maven POM in YAML, {projectdir}/pom.yml
:
By using the yaml inline map. or dictionary notation declaring a dependency uses way less characters then when using XML.
Continue reading →
The Thoughtworks Technology Radar is well known for showing technology trends and choices.
For my project I wanted to have the same thing, not use the hosted public version from Thoughtworks, but a selfhosted option.
Therefore I choose to base it on the Zalando opensource tech radar, and create a way to use a CSV file as input so updating would be an easy thing to do.
To accomplish that I took the following steps:
-
Create a folder to put the tech radar into: ${project-folder}
.
-
Start with the HTML5 Boilerplate index.html file and put it into the ${project-folder}
file.
-
Insert the snippets as documented at Zalando Tech Radar, with one adjustment.
I don’t fill the entries
array with entries, but will do that later on, from the input in the CSV file.
Note the names of the rings and quadrants, as they will be used in the next step, the CSV.
-
Create a CSV file (${project-folder}/data.csv
) as input for the tech radar.
It has columns for the ring and quadrant where a technology should be put, and an indicator for movement.
The names of the rings and quadrant should equal those in the configuration copied from the Zalando example.
If you changed them, use those names instead.
The movement indicator is (up, none, down) and in the next step translated in to value understood by the radar.
The CSV will be translated into entries for the radar.
-
Add the following D3.js library to parse CSV:
This library provides functions to parse CSV file(s) into a map structure per row in the file.
-
Create a function to transform a row in the CSV into an entry for the tech radar:
-
This is the diversion from the steps in the Zalando tech radar description.
Wrap the radar_visualization()
function a custom one, that takes an array of entry, to render the transformed rows, e.g. draw_radar(entries)
.
-
Finally glue everything together to fetch the CSV, parse and transform it, and draw the entries.
The code below uses the functions I defined in the previous steps
When you have followed the above steps, the result should look like this:
Continue reading →
Great projects keep moving forward. JUnit5 is available since September 2017 and Spock 1.2 is already complete. Since Spock is based on JUnit4, I wondered what it would take to use Spock 1.2 together with JUnit5.
As it turns out, it’s quite easy to make that happen. JUnit5 comes with the vintage engine to run JUnit4 based tests. If that is available on the test classpath, your Spock tests run like on JUnit4.
Continue reading →