Custom tasks page refers to publishing a custom task but not how to do it

At version 5.2.1 of https://docs.gradle.org/current/userguide/custom_tasks.html, near the top of the page, we see a description of the three ways to package a custom task.

For my use case, I seek to use the standalone project approach. But I’m stuck because when I build the project I see no evidence that the jar is published.

The standalone project approach has three critical elements: (1) create the project and source code, (2) publish the artifact, and (3) cite the artifact in some other project. The page I mentioned seems like it has everything I need except how to do #2.

When I scroll forward I get to Example 5 where above it says that the example is what I would code “when the JAR containing the task class has been published to a local repository”. Yet there is no help for how to publish a task written in groovy. I recognize that it probably doesn’t matter how the jar was created (i.e., source language).

If I try to get clever and change “implementation classpath” to “implementation files (%s)”, then gradle gives me an error.

All the other publishing artifact examples that I’ve found seems related only to publish application runtime code.

I have an empty settings.gradle file.

Here’s my build.gradle file:
plugins {
id ‘groovy’
id ‘maven-publish’
}

group = ‘com.me
version = ‘1.0’

dependencies {
implementation gradleApi()
implementation localGroovy()
}

publishing {
publications {
myLibrary(MavenPublication) {
from components.java
}
}
repositories {
maven {
name = ‘me’
url = “file://${buildDir}/repo”
}
}
}

Here’s my project before building:
$ find . -type f
./build.gradle
./settings.gradle
./src/main/groovy/org/gradle/ScaleImage.groovy

Here’s my build directory after building (“gradle build”):
$ find build -type f
build/classes/groovy/main/org/gradle/ScaleImage.class
build/libs/gradle-1.0.jar
build/tmp/jar/MANIFEST.MF