This message was deleted.
# kotlin-dsl
s
This message was deleted.
g
That's not an open repo, you'll have to paste
build.gradle.kts
here since no one can see it right now
c
I just made it public, please click again...
g
You don't seem to have
maven-publish
plugin applied. But if it is you'll also need to configure publication with
Copy code
publishing {
  publications.create<MavenPublication>("maven") {
    from(components["java"])
  }
}
or something similar
v
Don't forget that not everyone follows the good practices, but many still use evil
allprojects
and similar. In his root project he has an
allprojects
where he applies
maven-publish
, otherwise he also would not have the
publishToMavenLocal
task.
But yeah, no publication defined, so nothing to do
c
@grossws I did already try with the exact piece of code you give, and it didn't change anything. I did commit and push it. By the way, I naively thought that the publish plugin would automatically understand that the generated jar is the module to be published... @Vampire so the good practice is to declare the maven-publish plugin in each and every module?
v
The good practice is to write convention plugins that you apply in each project where those conventions should be effective. Things like
allprojects { ... }
or
subprojects { ... }
or any other form of cross-project configuration is bad and should be avoided. It makes the build harder to understand, harder to maintain, and works against some of the more sophisticated Gradle features present or yet to come.
c
Even when removing the allprojects clause, and declaring the publication as shown above, I still get the infamous
Skipping task ':skorm-jdbc:publishToMavenLocal' as it has no actions.
.
v
Well, the
publishToMavenLocal
task actually never has any actions (unless you add some which you shouldn't). It is a lifecycle task that just depends on the actual publication tasks.
c
@Vampire Well, the 'skorm jdbcpublish' task succeeds in publishing a sonatype artifact, so why would the publishToMavenLocal not work? There is something I don't get.
v
As I said, the task itself just like the
publish
task is just a lifecycle task without any actions. It just depends on the actual publishing tasks which do the work. If they don't, maybe provide a build scan that shows the problem
c
v
Yep worked fine exactly like expected, what's your problem?
publishToMavenLocal
depended on
publishMavenPublicationToMavenLocal
which did do the actual publishing
c
Ok, thank you. Yes, this time it worked...
👌 1