5

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.

Robin Green
  • 32,079
  • 16
  • 104
  • 187
Learner
  • 1,215
  • 1
  • 11
  • 26
  • 1
    This Stack Overflow question may be relevant: https://stackoverflow.com/questions/31880054/how-to-deploy-maven-sites-to-artifactory – Peter Ledbrook Aug 20 '18 at 09:29

2 Answers2

4

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.

ToYonos
  • 16,469
  • 2
  • 54
  • 70
0

Artifactory (you don't specify which repository are you using) has the "content browsing" option. It allows you deploy your javadocs like any other ordinary artifact (archive) and then browse its HTML content with a browser.

Juan Mellado
  • 14,973
  • 5
  • 47
  • 54
  • Unfortunately in Artifactory OSS, content browsing only allows you to browse individual files, e.g. HTML files - it doesn't support browsing inside zip files. I placed the bounty on this question, and I am using Artifactory OSS. – Robin Green Aug 17 '18 at 15:06
  • It seems that it's still not working in Artifactory OSS: https://www.jfrog.com/jira/browse/RTFACT-9803 . I wonder what your Maven builds are doing to have this work. – Peter Ledbrook Aug 20 '18 at 09:30