Skip to content
Permalink
Browse files

detect version

check for jar-file rather than target directory
  • Loading branch information...
jerous86 committed Apr 5, 2019
1 parent bed798a commit bf7095c7256744eb3c8c45216726afa5cf28d12b
Showing with 13 additions and 2 deletions.
  1. +13 −2 run.sh
15 run.sh 100644 → 100755
@@ -1,6 +1,17 @@
#!/bin/sh

if [ ! -d target ]; then
# This script runs the jar-file.
# If the jar-file is not present, it will compile using maven.
# Note that if the source has changed, the project will not recompile until the jar-file
# is removed.

set -ue

VERSION=$(cat pom.xml | paste -s - | grep -Eoi '<groupId>org.networkcalculus.snc.*?/version' | sed 's:.*version>\(.*\)</version.*:\1:g')
TARGET_JAR="target/SNC-${VERSION}-jar-with-dependencies.jar"
if [ ! -f "$TARGET_JAR" ]; then
mvn package
fi
java -jar target/SNC-2.1.0-SNAPSHOT-jar-with-dependencies.jar

java -jar "$TARGET_JAR"

0 comments on commit bf7095c

Please sign in to comment.
You can’t perform that action at this time.