Hello, I’m publishing a library which has both jav...
# gradle
a
Hello, I’m publishing a library which has both java and kotlin code and I’m including
sourceSets.main.allJava
in the sources jar. When I use
Go to definition
in any of the java code it works but on the kotlin it doesn’t, any ideia why? My publish gradle script looks like this
Copy code
apply plugin: 'maven-publish'

task sourcesJar(type: Jar) {
    from sourceSets.main.allJava
    classifier 'sources'
}

publishing {
    repositories {
        maven {
            name 'myRepo'
            url '<url>'
            credentials {
                username 'user'
                password 'password'
            }
        }
    }
    publications {
        mavenJava(MavenPublication) {
            from components.java
            artifact sourcesJar
        }
    }
}
c
The below may help:
Copy code
configure<JavaPluginExtension> {
   withJavadocJar()
   withSourcesJar()
}
…replaces the need to manually assemble & publish sources.
Copy code
java {
   withJavadocJar()
   withSourcesJar()

}
Groovy equivalent