Skip to content

Commit cb52f73

Browse files
authored
apacheGH-611: [Docs] Detect version from pom.xml (apache#613)
Fixes apacheGH-611.
1 parent 34e2b08 commit cb52f73

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

docs/source/conf.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,17 @@
2323
# -- Project information -----------------------------------------------------
2424
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
2525

26+
import pathlib
27+
import xml.etree.ElementTree as ET
28+
2629
project = 'arrow-java'
2730
copyright = '2025, Apache Arrow Developers'
2831
author = 'Apache Arrow Developers'
29-
release = '18.1.0'
32+
33+
top_level_pom_xml = pathlib.Path(__file__).parents[2] / "pom.xml"
34+
tree = ET.parse(top_level_pom_xml)
35+
ns = {"maven": "http://maven.apache.org/POM/4.0.0"}
36+
release = tree.getroot().find("maven:version", ns).text
3037

3138
# -- General configuration ---------------------------------------------------
3239
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

0 commit comments

Comments
 (0)