The way you are trying to include your plugin seems overcomplicated, all you should have to do is include it in the plugins block.
From the ktor documentation:
plugins { id("io.ktor.plugin") version "3.1.1" }