Tales from the jar side: Sharing Gradle settings, Major news events this week, Pebbles' birthday, and the Joy of watching Steph Curry
My wife said, "are you even listening to me?" I thought that was a strange way to start a conversation
Welcome, fellow jarheads, to Tales from the jar side, the Kousen IT newsletter, for the week of February 21 - February 27, 2022. This week I taught Week 3 of my Spring and Spring Boot in 3 Weeks course on the O’Reilly Learning Platform.
Regular readers of this newsletter are affectionately known as jarheads, and are far more intelligent, sophisticated, and attractive than the average newsletter reader. If you wish to become a jarhead, please subscribe using this button:
Whenever my newsletter becomes too long for email, you can read the full version online. If you miss an issue, the entire archive is there as well, and everything is free and always will be.
Gradle: I’ve Been Doing It Wrong
I often say there are two facts of life in the IT world:
You never have time to learn everything you need to know.
What you’ve already learned changes.
The conclusion is that we spend our careers prioritizing. We’re always saying, “is this worth my time?” and, as I’ve gotten older, “is this worth my energy?”
I noticed recently that Gradle has changed the recommended way to solve two fundamental issues. First, if you have a multi-project build, there is a new way to share settings and dependencies among them. The old way is illustrated by the GitHub repository for the Spock framework. There you will find inside the build.gradle file:
After the plugins section, there’s an ext block, which is used to set up the libs map that can be accessed in all the subprojects. Then there’s an allprojects block, for settings that apply to the top level as well as all subprojects, and a subprojects block that’s just for the children. I’ve been following this pattern for years with my own projects.
With the recent release of Gradle 7.4, I discovered that they prefer you make your own plugin for purposes like that. For example, I’ve now refactored my junit5_workshop project as follows. I now have a folder in the root called buildSrc/src/main/groovy with a file called myproject.conventions.gradle that contains:
and inside my build files in my subprojects spring, vintage, and test-results, I have a plugins block that includes the line:
id 'myproject.conventions'
That’s how my individual subprojects use the plugin, and I can share settings among them. I did this because in the Gradle 7.4 release notes introduced the idea of a single test report for multiple projects. Setting that up turned out to be more complicated than I expected, but I managed to get it to work.
The build.gradle file in my test-reports subproject consists entirely of
Now I can run the testAggregateTestReports task and get all the tests from all the subprojects in one HTML display:
The other thing in Gradle that changed is that now Gradle 7.4 supports a feature called version catalogs. In that case, you use the settings.gradle file to set up what are aliases for versions of your dependencies, and then you can use those aliases in all your projects.
The sample they show, along with a sample project that is now available, looks interesting, but I haven’t had time to try this out yet. I’m teaching another Introduction to Gradle class in a couple weeks, though, so I’ll be looking at it soon.
Incidentally, the Gradle newsletter for February pointed me to a really good video about the new features in Gradle 7.4:
I found that really useful. I just wish I didn’t have to change so many things as a result, but that’s the price you pay for working in an active area.
Our World This Week
This newsletter is not intended to be a commentary on politics, but this has been a rough week.
I’ve been watching three significant events this week. One is of minor importance in the scheme of things, but the others are big:
The owners of Major League Baseball teams have locked out the players and basically refuse to negotiate. It’s clear they want all the new revenue flooding into baseball, and they’re determined to break the union.
Governor Greg Abbott of Texas decided now was the right time to attack trans kids and any parents or care-givers who decide to help them:
Directing @TexasDFPS to conduct prompt & thorough investigations of any reported instances of Texas children being subjected to abusive gender-transitioning procedures.How despicable to you have to be to attack children for political gain?
The Russian invasion of Ukraine, which is going much worse than Putin could have imagined.
I could say a lot about each of them, but I’ll keep it short. First, the latter two came together in an amusing way:
I sent that to one of my friends in Texas, who loved it. :)
Next, I want to point out that there is one feature all three events have in common:
None of these actions were necessary
First, the MLB owners didn’t need to do a lockout in order to negotiate with the players. They could open the doors tomorrow and continue to negotiate under the current agreement, and it wouldn’t change a thing. Second, no trans kids actually receiving decent healthcare were threatening anybody. And third, while Putin doesn’t want Ukraine to join NATO, that wasn’t going to happen for years if at all, and when it does happen (which looks a lot more likely now), nobody was going to put missiles in Ukraine for a long time. In each example, a wealthy powerful person or persons decided they wanted something and they wanted it now. There were no crises to be solved. No arguments over major issues. No confrontations that threatened to spin out of control. Just evil people who decided, on their own, to do evil things.
Fortunately, all are receiving more resistance than they expected. The war is still in flux, of course, but the Russian military is having serious problems, and Putin can’t attack them because he might actually need their support when the currency markets open tomorrow and the ruble falls through the floor, taking much of the remains of the Russian economy with it.
Of the three, the only event I will be actively trying to fight is the attack on trans children. I tweeted this:
I believe helping them is the right thing to do, but I have another motive. I grew up Jewish, and if there’s one thing that’s drilled into you as a Jewish kid, it’s how bad things can get when attacking “others” becomes government policy.
Enough of all that, though. Now to lighten things up.
Tweets and More
If you have to explain a joke, …
I totally have to comment on this joke:
I thought it was funny, so I showed it to my wife and my son, which is when the real humor started. Both of them are, shall we say, a bit too pedantic at times. My wife is a retired lawyer, so at least she has an excuse. My son was just born that way.
What set them off? They both clearly believed the punchline should have been “Don’t tell me that’s a coincidence,” leaving out the “not”. They proceeded to argue with each other, at a high volume in my son’s case, that the posted form of the joke didn’t make any sense. Leaving out the “not” means that the joke teller was one of the conspiracy theorists. Including it meant … er … who knows? They both managed to argue what I’m pretty sure was the same position, but neither side was really listening anyway.
My position was (1) it’s a gag, so I don’t care as long as it’s funny, and (2) wow, people can really get worked up about this stuff. I stayed out of it as much as possible.
Pebbles and Me
It turns out there was a notable birthday this week.
Yes, Pebbles Flintstone was born on Feb 22, 1963.
If you click through to the thread, you discover:
Wilma Flintstone was the first animated character to be portrayed as pregnant.
The actress who voiced Wilma was also pregnant at the time, and gave birth the same day the episode was originally aired.
That episode is also the first time we see Fred and Wilma sharing a double bed rather than two separate beds.
Those posts were on Twitter, though, and someone on Twitter will always find a dark side:
Assuming that red hair is carried by a recessive gene, Fred could simply have one recessive gene for red and one dominant gene for black, and Barney is in the clear, at least by this measure.
Incidentally, my take on the Flintstones has always been that even though it was never shown, I assume Wilma and Betty had jobs that earned them about ten times what Fred and Barney made. It’s the only way the economics of that show worked at all.
Speaking of generation gaps
I was talking to my son, and during a commercial for the new online game Apex Legends he told me this:
My favorite reply came from the awesome Johanna Rothman:
You and me both, at least originally. They’re easy enough terms to Google, though in slang terms nuance is everything. Cringe these days still means cringe, but now it’s an adjective. POG is short for PogChamps, which is an expression of surprise or excitement, associated with a particular emote. I’m not going to link to it, though.
The Joy of Steph
Finally, I have to comment on the NBA All-Star game last weekend.
For those who don’t know, Stephan Curry is a small (6’ 2”, which is small by NBA standards) shooting guard for the Golden State Warriors. Over his career, he has revolutionized the game of basketball by having an almost unlimited range and a willingness to use it. He is already the career leader in made three-point shots, and any time he gets hot, it’s must-see TV.
But all that doesn’t begin to give you the experience of watching Steph. Let me compare that experience to watching the two players who are arguably the best in NBA history.
LeBron James is a tank with the grace of a ballet dancer. When you watch him, the feeling he inspires is awe. It’s incredible that anyone with that much power and force can be intimidating one moment, and smooth as silk the next. It’s dazzling, and when he’s on, he’s almost unstoppable. But sometimes, when the supporting cast lets him down or the mountain is too high to climb, he disengages.
Michael Jordan seemed like the human embodiment of rage and determination. He wanted to destroy his opponents in any way possible, and that fierce drive never stopped. Every season, every game, every play was a contest of wills that he defied his opponents to have the nerve to oppose, much less beat him. The downside was that the chip on his shoulder was so big that he could destroy even his own teammates.
Steph Curry is different. The overriding feeling that comes from watching Steph is joy. Just look at this picture, from the All-Star game last weekend, when Steph was draining 3s from all over the court:
Those are three Hall of Fame players, one of them the holder of the 3-point record Steph broke earlier this year, with a combined 80,000 points scored in the NBA between them. Steph reduced them to little kids who can’t stop laughing.
(BTW, Sue Bird, who sent that tweet, is a former UConn star, 3-point shooter, and surefire Hall of Famer herself. She tweeted the above after Steph’s 15th made 3. When he made the next (and final) one, she tweeted SPLASH again, of course. :)
Here’s a video of all 16 of Steph’s 3s:
Sure, it’s an All-Star game. Nobody was guarding him for at least half of those shots. He finally went cold down the stretch, and LeBron had to win it with a turn-around at the buzzer. I don’t care about any of that. This was joy, pure and simple, and if you’re reaction is to say, “yes, but,” then I feel sorry for you. I promise, you’re allowed to feel good every once in a while. I read it in a manual somewhere.
Steph doesn’t have the tools or the imposing physique or anywhere near the size or power of LeBron or Jordan. He’s quiet and unassuming, and makes all his teammates better. He’s also 33, and his best years are probably behind him. It’s been a while since he’s gone nuclear like that, and it will happen less and less over time. I promise, though, I’m going to enjoy it every single time.
In these very difficult days, with all the stress and fear and pain in the world, I hope you find something that brings you happiness. For me, one of those things is watching Steph Curry play basketball. 😂
As a reminder, you can see all my upcoming training courses on the O’Reilly Learning Platform here and all the upcoming NFJS Virtual Workshops here.
Last week:
Spring and Spring Boot in 3 Weeks, week 3, on the O’Reilly Learning Platform
This week:
Java Testing with Mockito and the Hamcrest Matchers, on the O’Reilly Learning Platform
Reactive Spring, an NFJS Virtual Workshop