Add a flag to deploy.sh script to not deploy artifacts to sonatype.
set -e
merge_src=true
+deploy_to_sonatype=true
while [[ "$1" != "" ]]; do
case $1 in
@@ -71,7 +72,11 @@ while [[ "$1" != "" ]]; do
;;
--no-merge-src ) merge_src=false
;;
- * ) exit 1
+ --no-deploy ) deploy_to_sonatype=false
+ ;;
+ * ) echo "Error: Unknown flag $1"
+ exit 1
+ ;;
esac
shift
done
@@ -135,6 +140,7 @@ create_artifact "${artifact}-javadoc.jar" ${artifact_directory}
# Replace version in template and generate the final pom.xml
sed -e "s/__VERSION__/${lib_version}/g" -e "s/__ARTIFACT_ID__/${artifact}/g" -e "s/__GROUP_ID__/${group_id}/g" ${pom_template} > ${artifact_directory}/pom.xml
+if [[ ${deploy_to_sonatype} == true ]]; then
# Use maven to sign and deploy jar, sources jar and javadocs jar to OSS sonatype
cd ${artifact_directory}
@@ -158,7 +164,12 @@ for i in "" sources javadoc; do
-DpomFile=pom.xml $classifier
done
+ rm -rf ${artifact_directory}
+else
+ echo "Artifacts created in ${artifact_directory}"
+fi
+
rm -rf ${javadoc_directory}
rm -rf ${classes_directory}
rm -rf ${srcs_directory}
-rm -rf ${artifact_directory}
+
