Is it possible to use the maven-publish plugin in a multi-project build? I keep getting the error Cannot configure the 'publishing' extension after it has been accessed.
I have a root project that includes a “core” project in a multi-project build.
in the root project & the “core” project build.gradle files, I have the following lines configuring the maven-publish plugin
publishing {
repositories {
maven {
url "my_repo"
}
}
publications {
mavenJava(MavenPublication) {
from project.components.java
}
}
}
If I’m in the “core” project home directory, I can successfully publish.
If I’m in the “root” project home directory, I get the error about the publishing extension already being accessed.
reading the docs, it seems like I should be able to configure the publishing plugin multiple times, as long as I don’t directly access it.