Replace convention properties with extension blocks in build.gradle

The Gradle documentation says that these convention properties are
deprecated and superseded by the java and application extension blocks.
Using the convention properties doesn't generate warnings yet, but it
can't hurt to switch to the now recommended way.
4 jobs for develop in 5 minutes and 22 seconds (queued for 14 seconds)
Status Name Job ID Coverage
  Test
passed tests #193220

00:01:33

passed tests:jdk-11 #193221

00:01:34

passed tests:jdk-14 #193222

00:01:29

 
  Deploy
passed publish #193223

00:01:56