@echo off

rem THIS BATCH SCRIPT FILE SHOWS THE SAMPLE TO INSTALL DOCUMENTUM REST EXSAMPLE PROJECT.
rem USERS NEED TO UPDATE BELOW VARIABLES BEFORE RUNNING THE SCRIPT.

set PROJECT_DIR=tmp
set PROJECT_GROUP_ID=com.acme.rest
set PROJECT_ARTIFACT_ID=acme-rest
set PROJECT_VERSION=1.0.0-SNAPSHOT
set PROJECT_PACKAGE=com.acme.rest

set DCTM_REST_SDK=C:/workspace/dctm-rest-sdk-7.2
set DCTM_REST_VERSION=7.2.0000.0242

set DCTM_REST_GROUP_ID=com.emc.documentum.rest
set DCTM_REST_EXT_GROUP_ID=com.emc.documentum.rest.extension
set DCTM_REST_EXT_ARTIFACT_ID=documentum-rest-extension-archetype

:install-archetype
call mvn install -DskipTests -f=%DCTM_REST_SDK%/maven-kit/archetype/pom.xml

:create-project
mkdir %PROJECT_DIR%
cd %PROJECT_DIR%
call mvn archetype:generate -DarchetypeCatalog=local -DarchetypeGroupId=%DCTM_REST_EXT_GROUP_ID% -DarchetypeArtifactId=%DCTM_REST_EXT_ARTIFACT_ID% -DgroupId=%PROJECT_GROUP_ID% -DartifactId=%PROJECT_ARTIFACT_ID% -Dversion=%PROJECT_VERSION% -Dpackage=%PROJECT_PACKAGE% -DinteractiveMode=false

:build-project
cd %PROJECT_ARTIFACT_ID%
call mvn install -DskipTests