Generate Javadoc Jar

Sorry my mistake. You’re right. javadoc on its own only produces the actual html.

Have you tried applying the 'maven-publish` plugin?

plugins{
    ...
    id 'maven-publish'
    ...
}
...
group = 'com.example'
version = '0.0.0'
...
task sourcesJar(type: Jar) {
    from sourceSets.main.allJava
    classifier = 'sources'
}

task javadocJar(type: Jar) {
    from javadoc
    classifier = 'javadoc'
}
...
publishing {
    publications {
        mavenJava(MavenPublication) {           
            artifactId = 'ziluckmichael'
            from components.java
            artifact sourcesJar
            artifact javadocJar
        }
    }
    repositories {
        maven {
            url 'repo'
        }
    }
}

…then gradle publish will get you your code, javadoc and sources jars in a repo directory as specified in the repositories{} stanza.

If you only want the javadoc, try removing the artifact sourcesJar and from components.java. I’ve never run that task without all three of them myself though. But it might work.