We need to publish JavaDoc to our maven repository as a site, not an archive, so that it can be browsed directly from there. Our maven-based projects do this already but we are having trouble finding the way to do this with Gradle - I think using "site deploy".
It is incredibly complicated to search for this as "site" is such an overloaded term and other searches don't produce any results.
Based on this script, here is a simple one which upload a directory structure. I tested it with my Artifactory OSS and it's working.
#!/bin/bash
# Recursively deploys folder content. Attempt checksum deploy first to optimize upload time.
repo_url="http://ip:port/artifactory"
tgt_repo="simple/myrepo"
user=myuser
pass=mypass
dir="$1"
if [ -z "$dir" ]; then echo "Please specify a directory to recursively upload from!"; exit 1; fi
root=${dir#$(dirname "$dir")/}
find "$dir" -type f | sort | while read f; do
rel="$(echo "$f" | sed -e "s#$dir##" -e "s# /#/#")";
echo "Uploading $f"
curl -k -u $user:$pass -T "$f" "${repo_url}/${tgt_repo}/${root}${rel}"
done
Now, you can turn this into Groovy code with a curl command.
Off course it's not as automatic as a simple Gradle task to execute but the job will be done.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With