Unable to load class 'MyCreateFileBinaryPlugin'.

i followed this guide https://docs.gradle.org/current/userguide/writing_plugins.html#binary_plugins to make a binary plugin that builds fine, however i created a new project to test it (published via mavenlocal) and i get the error Unable to load class 'MyCreateFileBinaryPlugin.' I attached the custom plugin (plugin manuale) and the testing plugin (plugin-test) any help is greatly appreciated
6 Replies
JavaBot
JavaBot6mo ago
This post has been reserved for your question.
Hey @Gone temporarily-need to lock in! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
Asdru
AsdruOP6mo ago
plugins {
id("java")
`java-gradle-plugin`
id("com.gradle.plugin-publish") version "1.2.1"
`kotlin-dsl`

}

group = "com.example"
version = "1.0.0"

gradlePlugin {
plugins {
create("binaryPlugin") {
id = "com.example.binaryPlugin"
implementationClass = "MyCreateFileBinaryPlugin"
}
}
}

publishing {
repositories {
mavenLocal()
}
}

repositories {
mavenCentral()
maven {
url = uri("https://company/com/maven2")
}
mavenLocal()
flatDir {
dirs("libs")
}
}
plugins {
id("java")
`java-gradle-plugin`
id("com.gradle.plugin-publish") version "1.2.1"
`kotlin-dsl`

}

group = "com.example"
version = "1.0.0"

gradlePlugin {
plugins {
create("binaryPlugin") {
id = "com.example.binaryPlugin"
implementationClass = "MyCreateFileBinaryPlugin"
}
}
}

publishing {
repositories {
mavenLocal()
}
}

repositories {
mavenCentral()
maven {
url = uri("https://company/com/maven2")
}
mavenLocal()
flatDir {
dirs("libs")
}
}
i think i narrwed the issue down to this not being able to detect the MyCreateFileBinaryPlugin class at src\main\kotlin\com\example\binaryPlugin\MyCreateFileBinaryPlugin.kt thanks! let me send the updated version then
JavaBot
JavaBot6mo ago
If you are finished with your post, please close it. If you are not, please ignore this message. Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
Asdru
AsdruOP6mo ago
Asdru
AsdruOP6mo ago
with that implementation the plugin is loaded but the task is missing ooor not... i think i was running the commands in the plugin directory, if i run them from the test project directory i get this error Cannot locate tasks that match 'plugin-test:createFileTaskFromBinaryPlugin' as project 'plugin-test' not found in root project 'plugin-manuale'.
JavaBot
JavaBot6mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.

Did you find this page helpful?