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.
1 job for master in 6 minutes and 31 seconds (queued for 4 minutes and 8 seconds)