This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git

commit be5fbb73ec5558f1273736aac7cf597529720ea8
Author: Lari Hotari <[email protected]>
AuthorDate: Sat Sep 27 08:44:11 2025 +0300

    Delete target api doc directory before copying
---
 contribute/release-process.md                  | 6 ------
 tools/pytools/lib/execute/javadoc_generator.py | 6 ++++++
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/contribute/release-process.md b/contribute/release-process.md
index 5d0c2601130..62c51f21e76 100644
--- a/contribute/release-process.md
+++ b/contribute/release-process.md
@@ -855,12 +855,6 @@ This step is for feature releases only, unless you're sure 
that significant Java
 
 :::
 
-If you are re-generating docs, it's necessary to remove the javadoc 
directories before generating:
-
-```shell
-rm -rf static/api/{client,admin,pulsar-functions}/4.0.x
-```
-
 After publish Java libraries, run the following script from the main branch of 
apache/pulsar-site repo:
 
 ```shell
diff --git a/tools/pytools/lib/execute/javadoc_generator.py 
b/tools/pytools/lib/execute/javadoc_generator.py
index dbe3e82dce0..27e0041074f 100644
--- a/tools/pytools/lib/execute/javadoc_generator.py
+++ b/tools/pytools/lib/execute/javadoc_generator.py
@@ -75,16 +75,22 @@ def execute(dir_or_version: str):
     dst = site_path() / 'static' / 'api' / 'client' / v
     run(mvn, '-Dlocale=en_US', '-pl', 'pulsar-client-api', 'javadoc:javadoc', 
cwd=src)
     client_apidocs = find_apidocs_path(src / 'pulsar-client-api')
+    if dst.exists():
+        shutil.rmtree(dst)
     shutil.copytree(client_apidocs, dst)
 
     # admin
     dst = site_path() / 'static' / 'api' / 'admin' / v
     run(mvn, '-Dlocale=en_US', '-pl', 'pulsar-client-admin-api', 
'javadoc:javadoc', cwd=src)
     admin_apidocs = find_apidocs_path(src / 'pulsar-client-admin-api')
+    if dst.exists():
+        shutil.rmtree(dst)
     shutil.copytree(admin_apidocs, dst)
 
     # function
     dst = site_path() / 'static' / 'api' / 'pulsar-functions' / v
     run(mvn, '-Dlocale=en_US', '-pl', 'api-java', 'javadoc:javadoc', cwd=(src 
/ 'pulsar-functions'))
     function_apidocs = find_apidocs_path(src / 'pulsar-functions' / 'api-java')
+    if dst.exists():
+        shutil.rmtree(dst)
     shutil.copytree(function_apidocs, dst)
\ No newline at end of file

Reply via email to