diff --git a/pom.xml b/pom.xml
index a39eb2c..e1a9b09 100644
--- a/pom.xml
+++ b/pom.xml
@@ -16,6 +16,8 @@
distro
+ 7.0.42
+ 1.2.0-SNAPSHOT
src/resources
UTF-8
@@ -42,14 +44,14 @@
org.gcube.distribution
smartgears-distribution
- LATEST
+ ${smartgear.version}
tar.gz
org.apache.tomcat
tomcat
- 7.0.42
+ ${tomcat.version}
tar.gz
@@ -72,8 +74,15 @@
war
+
+
+
+ org.apache.maven.plugins
+ maven-resources-plugin
+ 2.6
+
- copy-setup
+ copy-resources
copy-resources
diff --git a/src/resources/setup.sh b/src/resources/setup.sh
index 7389b19..07994e3 100644
--- a/src/resources/setup.sh
+++ b/src/resources/setup.sh
@@ -1,8 +1,8 @@
#!/bin/bash
TOMCAT_DST_FOLDER="tomcat"
-TOMCAT_VERSION="7.0.42"
+TOMCAT_VERSION="${tomcat.version}"
TOMCAT_PID_FILENAME="pid.txt"
-SMARTGEAR_DISTRIBUTION_DIRECTORY="smartgears-distribution-1.2.0-SNAPSHOT"
+SMARTGEAR_DISTRIBUTION_DIRECTORY="smartgears-distribution-${smartgear.version}"
SMARTGEAR_ROOT=${PWD}
GHN_HOME=${SMARTGEAR_ROOT}/${SMARTGEAR_DISTRIBUTION_DIRECTORY}
@@ -14,6 +14,33 @@ export GHN_HOME=${GHN_HOME}
export CATALINA_PID=${SMARTGEAR_ROOT}/${TOMCAT_PID_FILENAME}
export CATALINA_HOME=${SMARTGEAR_ROOT}/${TOMCAT_DST_FOLDER}"
+
+function showhelp {
+ echo -e "\nUsage: setup.sh [-d ] [-f |-h] \n"
+ echo " = the directory where installing SmartGear"
+ echo " By default, this is the directory of this script."
+ echo " f = Really run the setup. By default it will be a dry-run"
+ echo -e " h = shows this help.\n"
+}
+
+while getopts ":d:fh" opt; do
+ case $opt in
+ d) distro=$OPTARG;;
+ f) force="true";;
+ h) showhelp
+exit 0 ;;
+ :) echo -e "\nERROR:option -$OPTARG requires an argument." >&2 ;
+ showhelp;
+ echo -e "\naborting.\n"
+ exit 1;;
+ \?) echo -e "\nERROR:invalid option: -$OPTARG";
+ showhelp;
+ echo -e "\naborting.\n"
+ exit 1 >&2 ;;
+ esac
+done
+
+
echo "Creating tomcat symlink..."
ln -s apache-tomcat-${TOMCAT_VERSION} ${TOMCAT_DST_FOLDER}
ls -l ${TOMCAT_DST_FOLDER}
@@ -43,6 +70,6 @@ echo "- Launch tomcat from ${SMATGEAR_ROOT} using the command ${CATALINA_STARTUP
echo ""
echo "By default tomcat start on 8080 port.
-If you want to change this port remeber to modify ${CONTAINER_XML} consistently"
+If you want to change this port REMEMBER to modify ${CONTAINER_XML} consistently"