Looking for an example on how a custom plugin invokes another plugin/task

Directly invoking task methods isn’t how tasks are supposed to be used. The Gradle script is supposed to create dependencies between tasks, let Gradle resolve the build sequence and execute the tasks.

See this comment and this other comment