summaryrefslogtreecommitdiffstats
path: root/Monitoring/MonitoringTool/PacketTracking/scripts/m2classpath.sh
diff options
context:
space:
mode:
Diffstat (limited to 'Monitoring/MonitoringTool/PacketTracking/scripts/m2classpath.sh')
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/scripts/m2classpath.sh57
1 files changed, 57 insertions, 0 deletions
diff --git a/Monitoring/MonitoringTool/PacketTracking/scripts/m2classpath.sh b/Monitoring/MonitoringTool/PacketTracking/scripts/m2classpath.sh
new file mode 100644
index 0000000..b39c22e
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/scripts/m2classpath.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+# Bootstrap CAN project
+#
+# ==[ START CONFIG ]==
+JAVA=java
+
+# ==[ END CONFIG ]==
+CMD=$1
+M2CLASSPATH=$2
+CLASSPATH_FILE=.m2classpath
+usage () {
+ cat <<EOT
+=======[ Maven Classpath extractor]=======
+
+Extracts maven class path for launching scripts.
+
+USAGE: this script should be called from within maven using
+ the exec-maven-plugin via "mvn compile exec:exec"
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.1</version>
+ <configuration>
+ <executable>../scripts/m2classpath.sh</executable>
+ <arguments>
+ <argument>create_classpath_file</argument>
+ <classpath />
+ </arguments>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+
+EOT
+}
+# ==[ create classh path file via maven ]==
+create_classpath_file () {
+ if [ "$M2CLASSPATH" != "" ]; then
+ echo "#=> Creating $CLASSPATH_FILE"
+ # FIXME worldmap target class path
+ echo ./target/classes:../../worldmap/target/classes:$M2CLASSPATH > $CLASSPATH_FILE
+ else
+ echo "ERROR: this script must be called via 'mvn compile exec:exec'"
+ fi
+}
+# ==[ main switch ]==
+case $CMD in
+ create_classpath_file)
+ create_classpath_file
+ ;;
+ *)
+ usage
+ ;;
+esac
+