Use jwebassemble-gradle plugin from local jar

I did a build of jwebassembly-gradle, I have copied the jar, source jar, and javadoc jar files to a sub directory “libs” in my project directory structure. I am using Gradle 6.8.2. I am getting the error “Plugin [id: ‘jwebassembly-gradle’] was not found in any of the following sources:”

How can I fix this? All the searches I have done say this should work.

// this handles the actual build script (build.gradle) dependencies!
buildscript {
    repositories {
        flatDir {
            // to use local builds
            dirs 'libs'
        }
    }
    dependencies {
        classpath fileTree(include: ['*.jar'], dir: 'libs')
        classpath files('libs/jwebassembly-gradle-0.4.jar')
        classpath files('libs/jwebassembly-gradle-0.4-sources.jar')
        classpath files('libs/jwebassembly-gradle-0.4-javadoc.jar')
    }
}

plugins {
    id 'java'
    id 'application'
    id 'jwebassembly-gradle'
}

repositories {
    flatDir {
        // to use local builds
        dirs 'libs'
    }
    mavenCentral()
}


jar {
    manifest {
        attributes(
            "Specification-Title" : "",
            "Specification-Version" : project.version,
            "Specification-Vendor" : "",
            "Implementation-Title" : project.group,
            "Implementation-Version" : project.version,
            "Implementation-Vendor" : "",
            "Main-Class" : "com.myproject.UrlImageGrabber"
        )
    }
}

dependencies {
    classpath fileTree(include: ['*.jar'], dir: 'libs')
    classpath files('libs/jwebassembly-gradle-0.4.jar')
    classpath files('libs/jwebassembly-gradle-0.4-sources.jar')
    classpath files('libs/jwebassembly-gradle-0.4-javadoc.jar')

	// other dependencies ..

}

task sourcesJar(type: Jar) {
   archiveBaseName=artifactBaseName
   classifier 'sources'
   from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
   archiveBaseName=artifactBaseName
   classifier 'javadoc'
   from javadoc.destinationDir
}

task(debug, dependsOn: 'classes', type: JavaExec) {
    main = mainClassName
    classpath = sourceSets.main.runtimeClasspath
    args ''
    debug true
}

//task webAssembly() {
//
//}

build {
    doLast {
//        webAssembly()
    }
}

artifacts {
   archives sourcesJar
   archives javadocJar
}

Besides that you probably just use the wrong id for the plugin (should be de.inetsoftware.jwebassembly, not jwebassembly-gradle), you have a large overkill in adding the jar multiple times to multiple places and even adding javadocs and sources to the classpath. To use a local build of the plugin, you should instead use a composite build by including the build with pluginManagement { includeBuild(...) } in the settings script, given the Gradle version that plugin is using is compatible with the Gradle version you are using. If that is not the case, using the buildscript block to add the plugin to the classpath seems ok, but even there you have 2.5 ways done, via fileTree, via indiviual files and additionally you declared a repository that you then do not use (that’s the 0.5). You should choose one of those ways then.