-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathcheck.sh
executable file
·35 lines (24 loc) · 1.18 KB
/
check.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
MYDIR=$(dirname $0)
MYJAR=$MYDIR/target/serianalyzer-0.0.1-SNAPSHOT-jar-with-dependencies.jar
WHITELIST=$MYDIR/whitelist
JRE=/opt/oracle-jdk-bin-1.8.0.66/jre/lib/
set -e
ARTIFACT="$1"
WORKDIR=$(realpath $(pwd))
if [ ! -d "$ARTIFACT" ]
then
if [ ! -f "$WORKDIR/pom.xml" ]
then
mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:get -Dartifact=${ARTIFACT}:pom -DrepoUrl=http://repository.sonatype.org/content/repositories/central -Ddest=${WORKDIR}/pom.xml
fi
mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:copy -Dartifact=${ARTIFACT}:jar -DrepoUrl=http://repository.sonatype.org/content/repositories/central -DoutputDirectory=$WORKDIR/jars/ || true
echo ${@:2}
mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:copy-dependencies -DoutputDirectory=$WORKDIR/jars/ -DincludeScope=runtime -DrepoUrl=http://repository.sonatype.org/content/repositories/central ${@:2}
TARGETS=$(ls $WORKDIR/jars/*.jar)
else
TARGETS=$@
fi
echo "Running analysis"
echo java -Xmx8G -cp "$MYJAR" serianalyzer.Main --whitelist $WHITELIST -d -o state $JRE $TARGETS
java -Xmx12G -cp "$MYJAR" serianalyzer.Main --whitelist $WHITELIST -d -o state $JRE $TARGETS 2>&1 | tee analyze.log