{"record":{"id":"7d9a2c37ae3e9444","repo":"apache/kafka","slug":"kafkapublicapichecker-javadocjarpath-is-not-set-e","errorCode":null,"errorMessage":"kafkaPublicApiChecker.javadocJarPath is not set. Either configure it explicitly on the extension, or apply this plugin to a project that defines a 'javadocJar' Jar task whose output the plugin can wire automatically.","messagePattern":"kafkaPublicApiChecker\\.javadocJarPath is not set\\. Either configure it explicitly on the extension, or apply this plugin to a project that defines a 'javadocJar' Jar task whose output the plugin can wire automatically\\.","errorType":"validation","errorClass":"GradleException","httpStatus":null,"severity":"error","filePath":"api-checker/gradle-plugins/src/main/java/org/apache/kafka/gradle/KafkaPublicApiCheckerTask.java","lineNumber":137,"sourceCode":"                    violations.size(), report.getAbsolutePath());\n\n                if (failOnViolation.get()) {\n                    throw new GradleException(message);\n                } else {\n                    getLogger().warn(message);\n                }\n            } else {\n                getLogger().info(\"No public API violations found.\");\n            }\n\n        } catch (IOException e) {\n            throw new GradleException(\"Failed to check public API: \" + e.getMessage(), e);\n        }\n    }\n\n    private File getJavadocJarFile() {\n        if (!javadocJarPath.isPresent()) {\n            throw new GradleException(\"kafkaPublicApiChecker.javadocJarPath is not set. \"\n                    + \"Either configure it explicitly on the extension, or apply this plugin to a \"\n                    + \"project that defines a 'javadocJar' Jar task whose output the plugin can \"\n                    + \"wire automatically.\");\n        }\n        return javadocJarPath.get().getAsFile();\n    }\n\n    @Input\n    public Property<Boolean> getCheckerEnabled() {\n        return enabled;\n    }\n\n    @Input\n    public Property<Boolean> getFailOnViolation() {\n        return failOnViolation;\n    }\n\n    @InputFile","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/apache/kafka/blob/996fb4585aa1bcc8980b0e1b8d6b168b986cd979/api-checker/gradle-plugins/src/main/java/org/apache/kafka/gradle/KafkaPublicApiCheckerTask.java#L119-L155","documentation":"GradleException from KafkaPublicApiCheckerTask.getJavadocJarFile when the javadocJarPath RegularFileProperty is not present. The plugin can auto-wire from a 'javadocJar' task, but if neither explicit configuration nor that task exists, it fails fast with a message describing both remediation paths.","triggerScenarios":"!javadocJarPath.isPresent() at line 137. Happens when the build script does not set kafkaPublicApiChecker.javadocJarPath AND the project has no 'javadocJar' Jar task for the plugin to wire automatically.","commonSituations":"Applying the plugin in a project that uses a custom doc task name; applying before the java plugin so no javadocJar task exists; shadowing/renaming the jar task.","solutions":["Set javadocJarPath explicitly: kafkaPublicApiChecker.javadocJarPath = layout.buildDirectory.file('libs/foo-javadoc.jar').","Ensure the 'java' plugin (and a javadocJar task) is applied so the plugin can auto-wire.","If you have a differently named task, point javadocJarPath at its archiveFile: tasks.named('myJavadocJar').flatMap { it.archiveFile }.","Add the task to the project: task javadocJar(type: Jar) { from javadoc; archiveClassifier = 'javadoc' }."],"exampleFix":"// before — no javadocJar task, no explicit path\napply plugin: 'kafka-public-api-checker'\n// after — explicit path\nkafkaPublicApiChecker {\n  javadocJarPath = layout.buildDirectory.file('libs/my-module-1.0-javadoc.jar')\n}","handlingStrategy":"validation","validationCode":"// In build.gradle\nif (!plugins.hasPlugin('java')) apply plugin: 'java'\ntasks.register('javadocJar', Jar) { archiveClassifier = 'javadoc'; from tasks.named('javadoc') }\n// or set explicitly:\n// kafkaPublicApiChecker.javadocJarPath = layout.buildDirectory.file('libs/foo-javadoc.jar')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Apply the java plugin so a javadocJar task is available for auto-wiring.","If you use a custom doc task, set javadocJarPath explicitly.","Add a doFirst asserting javadocJarPath.isPresent()."],"tags":["gradle","api-checker","configuration","javadoc"],"backgroundTag":null,"analyzedSha":"996fb4585aa1bcc8980b0e1b8d6b168b986cd979","analyzedAt":"2026-08-11T22:03:28.655Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}