-# Second, build a core Docker Image
-echo Building aaf_$AAF_COMPONENT...
+# Third Copy AAF Executables to a BUILD Directory, for easy Cleanup
+echo "### Copy to aaf_DBUILD"
+if [ -e "../aaf_$VERSION" ]; then
+ cp -Rf ../aaf_$VERSION ../aaf_DBUILD
+elif [ -e "../aaf_$JAR_VERSION" ]; then
+ cp -Rf ../aaf_$JAR_VERSION ../aaf_DBUILD
+else
+ echo "ERROR: No AAF Built. use Maven"
+ exit
+fi
+if [ ! "$VERSION" = "$JAR_VERSION" ]; then
+ START_DIR=$(pwd)
+ # Convert SNAPSHOT issues
+ cp -Rf ../aaf_$VERSION ../aaf_DBUILD
+ cd ../aaf_DBUILD/lib
+ # If Built Jars are "SNAPSHOT", convert to NON SNAPSHOT
+ for J in $(ls *-SNAPSHOT*); do mv $J ${J/-SNAPSHOT/}; done
+ cd ../bin
+ rm *.bat
+ for S in $(ls); do
+ sed -e "/$VERSION/s/$VERSION/$JAR_VERSION/g" $S > tmp
+ mv tmp $S
+ done
+ cd ${START_DIR}
+fi
+
+########
+# Third, build a core Docker Image to be used for all AAF Components
+cp ../sample/bin/pod_wait.sh ../aaf_DBUILD/bin