Merge changes Ic53c9f04,Iae5644f6,Ib3975607
[transportpce.git] / tests / build_controller.sh
1 #!/bin/sh
2
3 set -e
4
5 current_dir=$PWD
6
7 cd $(dirname $0)
8
9 #install maven and JDK11 on the Gate since they are not there by default
10 which mvn >/dev/null || ./installMavenCentOS.sh
11 cd ../
12
13 #patch OLM constant to speed up tests, unnecessary for PCE tests
14 sed -i'_' 's@=.*//#FUNCTESTVAL=@=@g' olm/src/main/java/org/opendaylight/transportpce/olm/util/OlmUtils.java
15 if [ "$USE_LIGHTY" != "True" ]; then
16     for suffix in 121 221 71; do
17         rm -rf "karaf$suffix"
18         cp -r karaf "karaf$suffix"
19     done
20 fi
21
22 #build controller, source JDK_JAVA_OPTIONS to remove illegal reflective acces warnings introduced by Java11
23 . "$current_dir"/reflectwarn.sh
24 mvn clean install -B -q -s tests/odl_settings.xml -DskipTests -Dmaven.javadoc.skip=true -Dodlparent.spotbugs.skip -Dodlparent.checkstyle.skip
25
26 mv  olm/src/main/java/org/opendaylight/transportpce/olm/util/OlmUtils.java_  olm/src/main/java/org/opendaylight/transportpce/olm/util/OlmUtils.java
27
28 #patch Karaf exec for the same reason at runtime and also to have the possibility to use alternative ports
29 ./karaf/target/assembly/ressources/post_install_for_tests.sh
30
31 #build Lighty if needed
32 if [ "$USE_LIGHTY" = "True" ]; then
33     cd lighty
34     ./build.sh
35 fi