Parsing xml for the latest version
@@ -59,9 +59,9 @@ get_detect() {
DETECT_SOURCE="https://blackducksoftware.github.io/hub-detect/${DETECT_LATEST_SNAPSHOT}"
else
if [ -z "${DETECT_RELEASE_VERSION}" ]; then
- DETECT_SOURCE="http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.blackducksoftware.integration&a=hub-detect&v=LATEST"
- FILE_NAME=$(curl -Ls -w %{url_effective} -o /dev/null "http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.blackducksoftware.integration&a=hub-detect&v=LATEST" | awk -F/ '{print $NF}')
- DETECT_DESTINATION="${DETECT_JAR_PATH}/${FILE_NAME}"
+ DETECT_RELEASE_VERSION=$(curl http://repo2.maven.org/maven2/com/blackducksoftware/integration/hub-detect/maven-metadata.xml | grep latest | sed -e 's@<latest>@@' -e 's@</latest>@@' -e 's/^[ \t]*//')
+ DETECT_SOURCE="http://repo2.maven.org/maven2/com/blackducksoftware/integration/hub-detect/${DETECT_RELEASE_VERSION}/hub-detect-${DETECT_RELEASE_VERSION}.jar"
+ DETECT_DESTINATION="${DETECT_JAR_PATH}/hub-detect-${DETECT_RELEASE_VERSION}.jar"
else
DETECT_SOURCE="http://repo2.maven.org/maven2/com/blackducksoftware/integration/hub-detect/${DETECT_RELEASE_VERSION}/hub-detect-${DETECT_RELEASE_VERSION}.jar"
DETECT_DESTINATION="${DETECT_JAR_PATH}/hub-detect-${DETECT_RELEASE_VERSION}.jar"
