Unable to use my published plugin

I have recently published a plugin on the gradle plugin portal
https://plugins.gradle.org/plugin/io.github.vivekgupta4git.mvvm-arch
but I am unable to use it on other projects.
I just noticed, there are two directories under https://plugins.gradle.org/m2/io/github/vivekgupta4git/
mvvm-arch
mvvm
I guess, I missed something while publishing. here is my build.gradle file.

plugins{
    `kotlin-dsl`
    id("com.gradle.plugin-publish") version "1.2.1"
}

group = "io.github.vivekgupta4git"
version = "1.0.0"
dependencies{

    implementation("androidx.room:room-common:2.6.1")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1")
    implementation("com.squareup.retrofit2:retrofit:2.11.0")
    implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0")
    implementation("com.android.tools.build:gradle:8.5.2")

    //noinspection GradleDependency
    implementation("com.squareup:kotlinpoet:1.15.0"){
        exclude(module = "kotlin-reflect")
    }

}
gradlePlugin{
    website = "https://vivekgupta4git.github.io/"
    vcsUrl = "https://github.com/vivekgupta4Git/GenerateArchitecture.git"
    plugins.create("mvvmArch") {
        id = "io.github.vivekgupta4git.mvvm-arch"
        displayName = "Mvvm Architecture Plugin"
        implementationClass = "MvvmArchPlugin"
 
        
    }
}

If you would not have both directories, then you would have missed something.
Those two are perfectly expected.
One is your code artifact, the other is the plugin marker artifact.

Why you cannot use it in another project is hard to tell as long as you do not share any information what that means. For example, do you get an error message? Which? My crystal ball is in the repair shop unfortunately.

@Vampire I thought you had your crystal ball repaired :laughing:

A problem occurred configuring project ':app'.
> Could not resolve all artifacts for configuration ':app:classpath'.
   > Could not resolve io.github.vivekgupta4git:mvvm:1.0.1.
     Required by:
         project :app > io.github.vivekgupta4git.mvvm-arch:io.github.vivekgupta4git.mvvm-arch.gradle.plugin:1.0.1
 > No matching variant of io.github.vivekgupta4git:mvvm:1.0.1 was found. The consumer was configured to find a library for use during runtime, compatible with Java 17, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.7' but:
          - Variant 'apiElements' declares a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component for use during compile-time, compatible with Java 22 and the consumer needed a component for use during runtime, compatible with Java 17
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.7')
          - Variant 'javadocElements' declares a component for use during runtime, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about its target Java version (required compatibility with Java 17)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.7')
          - Variant 'runtimeElements' declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component, compatible with Java 22 and the consumer needed a component, compatible with Java 17
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.7')
          - Variant 'sourcesElements' declares a component for use during runtime, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about its target Java version (required compatibility with Java 17)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.7')

in my test project module level build file

plugins {
    alias(libs.plugins.android.application)
    alias(libs.plugins.jetbrains.kotlin.android)
    id("io.github.vivekgupta4git.mvvm-arch") version "1.0.1"

}

You build your plugin so that it is compatible with Java 22, but try to consume it in a Gradle build that is executed using Java 17.

so will this work ? @Vampire
I have updated my plugin’s build file

kotlin{
    jvmToolchain{
        languageVersion.set(JavaLanguageVersion.of(17))
    }
}

Probably.
If it is enough for you to support running Gradle with your plugin with Java 17.
Current minimum version to run Gradle is Java 8 for practically all versions.
You can easily verify up-front by using ./gradlew outgoingVariants and checking the org.gradle.jvm.version of your variants.