RTD_BUILD_VERSION="${GERRIT_BRANCH/\//-}"
fi
-curl -X POST --data "version_slug=$RTD_BUILD_VERSION" "https://readthedocs.org/build/$RTD_PROJECT"
+CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
+ -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
+ -v x:username -o ":" -v x:password \
+ "$SETTINGS_FILE")
+
+RTD_BUILD_TOKEN=$(echo "$CREDENTIAL" | cut -f2 -d:)
+
+curl -X POST -d "branches=$RTD_BUILD_VERSION" -d "token=$RTD_BUILD_TOKEN" "$RTD_BUILD_URL"
+