--- /dev/null
+#!/bin/bash
+
+# @License EPL-1.0 <http://spdx.org/licenses/EPL-1.0>
+##############################################################################
+# Copyright (c) 2015 The Linux Foundation and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+##############################################################################
+
+ARTIFACT_DIR=".sign-artifacts"
+SIGNATURES_DIR="gpg-signatures"
+
+
+function print_usage {
+ echo "Usage: $0 sign <url>"
+ echo ""
+ echo " sign : Downloads and Signs artifacts from Nexus"
+}
+
+
+# Downloads artifacts from a Nexus URL and creates gpg signatures for them
+# and copies the signatures to a separate directory.
+function sign {
+ echo "Signing artifacts..."
+
+ if [ -d "$ARTIFACT_DIR" ]; then
+ echo "$ARTIFACT_DIR directory exists. Clearing..."
+ rm -rf $ARTIFACT_DIR
+ fi
+
+ mkdir $ARTIFACT_DIR
+ cd $ARTIFACT_DIR
+
+ echo "Fetching artifacts from $URL"
+ # Fetch Artifacts
+ wget --recursive --execute robots=off --no-parent --quiet \
+ --no-host-directories --cut-dirs=3 \
+ $URL
+
+ # Remove files that don't need signing
+ find . -type f \
+ -name "*.asc" \
+ -o -name "*.sha1" \
+ -o -name "*.md5" \
+ -o -name "_maven.repositories*" \
+ -o -name "_remote.repositories*" \
+ -o -name "maven-metadata-local.xml*" \
+ -o -name "maven-metadata.xml*" \
+ -o -name "index.html*" | xargs rm
+
+ for f in `find . -type f ! -name "*.asc" ! -name "*.sha1" ! -name "*.md5"`
+ do
+ echo "Signing $f"
+ gpg --batch -abq $f
+ done
+
+ cd ..
+
+ if [ -d "$SIGNATURES_DIR" ]; then
+ echo "$SIGNATURES_DIR directory exists. Clearing..."
+ rm -rf $SIGNATURES_DIR
+ fi
+
+ rsync -avz --include '*/' --include '*.asc' --exclude '*' \
+ "${ARTIFACT_DIR}/org" "${SIGNATURES_DIR}"
+}
+
+
+if [ -z "$2" ]; then
+ print_usage
+ exit 1
+fi
+
+MODE=$1
+URL=$2
+
+if [ "$MODE" == "sign" ]; then
+ sign
+else
+ echo "ERROR: Invalid mode."
+ print_usage
+ exit 1
+fi
<url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
<distributionManagement>
- <site>
- <id>opendaylight-site</id>
- <url>${nexus.site.url}/${project.artifactId}/</url>
- </site>
+ <site>
+ <id>opendaylight-site</id>
+ <url>${nexus.site.url}/${project.artifactId}/</url>
+ </site>
</distributionManagement>
**Note:** For the project root pom.xml remove the final path
* https://maven.apache.org/plugins/maven-site-plugin/examples/creating-content.html
* https://maven.apache.org/plugins/maven-site-plugin/examples/sitedescriptor.html
+
+## <a name="aggregate_apidocs">Aggregating Java apidocs</a>
+
+Javadoc is generated automatically for each bundle however to aggregate them
+all into a single convenient url we need to ensure that the root pom has a
+profile to activate it. The following should be copied into the profiles
+section of the project root pom.
+
+ <profiles>
+ <profile>
+ <!--
+ This profile is to ensure we only build javadocs reports
+ when we plan to deploy Maven site for our project.
+ -->
+ <id>maven-site</id>
+ <activation>
+ <file>
+ <exists>${user.dir}/deploy-site.xml</exists>
+ </file>
+ </activation>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <inherited>false</inherited>
+ <executions>
+ <execution>
+ <id>aggregate</id>
+ <goals>
+ <goal>aggregate</goal>
+ </goals>
+ <phase>package</phase>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>