Use dedicated TMP directory in order to prevent filling OS-TMP directory

The JUnit tests of the RAP Runtime build create temporary files in the
standard place defined by the JVM and the OS. By setting the property
java.io.tmpdir to a directory below the build workspace we make it
easier to clean up those left-overs.

Bug 435004: RAP Unit Tests are not cleaning up after themselves
https://bugs.eclipse.org/bugs/show_bug.cgi?id=435004

Change-Id: Iceecf0c956605e97c0358e6116de501a77f6d386
Signed-off-by: Markus Knauer <mknauer@eclipsesource.com>
diff --git a/releng/org.eclipse.rap.incubator.releng/scripts/build.sh b/releng/org.eclipse.rap.incubator.releng/scripts/build.sh
index cbaa5d3..805efad 100755
--- a/releng/org.eclipse.rap.incubator.releng/scripts/build.sh
+++ b/releng/org.eclipse.rap.incubator.releng/scripts/build.sh
@@ -58,6 +58,11 @@
 done
 
 ######################################################################
+# setup tmp directory for JUnit tests and p2 operations
+TEMPDIRECTORY="${WORKSPACE}/tmp"
+mkdir -p "${TEMPDIRECTORY}"
+
+######################################################################
 # git clone build repository
 RELENG_REPOSITORY_NAME="org.eclipse.rap.incubator.releng"
 REPOSITORY=${GIT_INCUBATOR_BASE}/${RELENG_REPOSITORY_NAME}
@@ -79,7 +84,7 @@
 BUILD_DIRECTORY=${WORKSPACE}/${REPOSITORY_NAME}/${BUILD_PROJECT_PATH}
 echo "Starting build in ${BUILD_DIRECTORY}"
 cd ${BUILD_DIRECTORY}
-${MVN} -e clean package $SIGNPROFILE -Dmaven.repo.local=${MAVEN_LOCAL_REPO_PATH} -Drap-repository=${RAP_REPOSITORY}
+${MVN} -e clean package $SIGNPROFILE -Dmaven.repo.local=${MAVEN_LOCAL_REPO_PATH} -Drap-repository=${RAP_REPOSITORY} -Djava.io.tmpdir="$TEMPDIRECTORY"
 EXITCODE=$?
 if [ "$EXITCODE" != "0" ]; then
   echo "Maven exited with error code " + ${EXITCODE}