Attach sources to kotlin library project don't show up in AS
This is what we have for Maven Publication.
task androidSourcesJar(type: Jar) { archiveClassifier.set('sources') from android.sourceSets.main.java.srcDirs}
And then you can use artifact androidSourcesJar
.