#!/bin/bash
dir=`dirname $0`
ARCHETYPE_ARTIFACT=vaadin-archetype-application
. $dir/validate-archetype-common.sh
mvn archetype:generate -DarchetypeGroupId=$ARCHETYPE_GROUP -DarchetypeArtifactId=$ARCHETYPE_ARTIFACT -DarchetypeVersion=$ARCHETYPE_VERSION -DarchetypeRepository=$ARCHETYPEREPO -DgroupId=$GROUP -DartifactId=$ART -Dversion=1.0-SNAPSHOT -DinteractiveMode=false
pushd $ART
# Add vaadin repo
$SED -i "s##vaadin-$ARCHETYPE_VERSION-staging$VAADINREPO#" pom.xml
# Add vaadin and plugin repo as plugin repos
$SED -i "s##vaadin-$ARCHETYPE_VERSION-plugin-staging$PLUGINREPO#" pom.xml
mvn install
mvn jetty:run
popd