Do not auto-add Java SDK Javadoc when a package list is passed to publish-docs

When a specific list of packages (e.g. a provider release wave like
"amazon cncf.kubernetes ...") is passed to the publish-docs-to-s3 workflow,
the Java SDK Javadoc was still built and appended to the S3 publish set
whenever java-sdk/ existed at the ref. That dragged java-sdk into a
providers-only publish and made the "Publish documentation to S3" job fail.

The Java SDK Javadoc is now only built/published for full doc builds
(include-docs == 'all') or when 'java-sdk' is explicitly requested.
diff --git a/.github/workflows/publish-docs-to-s3.yml b/.github/workflows/publish-docs-to-s3.yml
index 7d01cc6..7afff16 100644
--- a/.github/workflows/publish-docs-to-s3.yml
+++ b/.github/workflows/publish-docs-to-s3.yml
@@ -366,12 +366,22 @@
         with:
           persist-credentials: false
           ref: ${{ inputs.ref }}
-      - name: "Check whether the Java SDK exists at this ref"
+      - name: "Decide whether to build the Java SDK Javadoc"
         id: sdk-present
         env:
           REF: ${{ inputs.ref }}
+          INCLUDE_DOCS: ${{ inputs.include-docs }}
         run: |
-          if [[ -f "java-sdk/gradlew" ]]; then
+          # The Java SDK Javadoc is only built (and later published) for full doc
+          # builds (include-docs == 'all') or when 'java-sdk' is explicitly listed.
+          # When a specific list of packages is passed (e.g. a provider release
+          # wave like "amazon cncf.kubernetes ..."), the Java SDK must NOT be added
+          # automatically — otherwise the publish step drags java-sdk into a
+          # providers-only publish and the S3 publish fails.
+          if [[ "${INCLUDE_DOCS}" != "all" && " ${INCLUDE_DOCS} " != *" java-sdk "* ]]; then
+            echo "exists=false" >> "${GITHUB_OUTPUT}"
+            echo "include-docs='${INCLUDE_DOCS}' is a specific package list without 'java-sdk' — skipping Javadoc build."
+          elif [[ -f "java-sdk/gradlew" ]]; then
             echo "exists=true" >> "${GITHUB_OUTPUT}"
           else
             echo "exists=false" >> "${GITHUB_OUTPUT}"