This message was deleted.
# plugin-development
s
This message was deleted.
j
You can address the publication by its name on the publications container.E.g. in Kotlin DSL:
Copy code
publishing {
    publications.getByName<MavenPublication>("pluginMaven") { 
       // ...
    }
}
t
That said, you can also configure the coordinates the same as in any project:
project.group
and
project.version
in your
build.gradle{,.kts}
, and
rootProject.name
in your
settings.gradle{,.kts}
.
b
Thanks! That gets me what I needed. My actual case is, I have the plugin name as the
rootProject.name
, but my plugin is in a subproject, but I want to publish it with the
rootProject.name
artifact ID without altering the project name of the subproject. If there is a cleaner way to do that (plugin in subproject, but root project named with plugin name) let me know. 🙂
j
It would be cleaner if the subproject name and the artifact ID are the same. Internally, Gradle uses the subproject name as and “identity” and that cannot be changed. If this is only about the folder name the project is in, you can change the folder of the project `
Copy code
include('project-name-that-is-the-artifact-id')
project(':project-name-that-is-the-artifact-id').projectDir = file("the-other-name")
https://docs.gradle.org/current/userguide/fine_tuning_project_layout.html#sub:modifying_element_of_the_project_tree