summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhakonhall <hakon@yahoo-inc.com>2017-05-05 15:40:20 +0200
committerGitHub <noreply@github.com>2017-05-05 15:40:20 +0200
commit77c3ba555239462ab78b09cf4cb01479c5d65f37 (patch)
tree6f1b973ac55f709e0a1fd0e61d26528c10e89c3d
parenta8ae8dd1340482a0c61649600dfa48b89cbe130b (diff)
parent9eba1418fea6f4e02a81140e2931dd2f8720f746 (diff)
Merge pull request #2400 from yahoo/revert-2393-revert-2390-hakon/bootstrap-local-java-builds
Revert "Revert "Bootstrap local Java builds""
-rw-r--r--.gitignore1
-rw-r--r--README.md3
-rwxr-xr-xbootstrap.sh40
3 files changed, 36 insertions, 8 deletions
diff --git a/.gitignore b/.gitignore
index d1c452b4084..0f289299ac8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,3 +38,4 @@ Testing
/rules.ninja
*_test_app
/hadoop/dependency-reduced-pom.xml
+/vespa-hadoop/dependency-reduced-pom.xml
diff --git a/README.md b/README.md
index 1e60fb003fd..568f99e2a60 100644
--- a/README.md
+++ b/README.md
@@ -32,8 +32,7 @@ or use the prebuilt docker image
### Build Java modules
Java modules can be built on any environment having Java and Maven:
- sh bootstrap.sh
- mvn install
+ sh bootstrap.sh java
### Build C++ modules
source /opt/rh/devtoolset-6/enable
diff --git a/bootstrap.sh b/bootstrap.sh
index 940179ef020..3a4625cbaf0 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -12,10 +12,11 @@ elif [ "$1" = "full" ]; then
# Build all java modules required by C++ testing
MODE=full
elif [ "$1" = "java" ]; then
- # Build minial set of java modules requires to run mvn install from the source root
+ # Build minial set of java modules, then run mvn install with arguments $2,
+ # $3, etc.
MODE=java
elif [ "$1" = "default" ]; then
- :
+ MODE=default
elif [ "$1" = "-h" -o "$1" = "--help" ]; then
usage
exit 0
@@ -26,15 +27,39 @@ else
fi
mvn_install() {
- mvn install -Dmaven.test.skip=true -Dmaven.javadoc.skip=true $@
+ mvn install -Dmaven.test.skip=true -Dmaven.javadoc.skip=true "$@"
}
# Generate vtag map
top=$(dirname $0)
$top/dist/getversion.pl -M $top > $top/dist/vtag.map
-# These modules are required to be available to maven for it to calculate the
-# Vespa java dependency graph.
+# NOTES ON BUILDING JAVA MODULES
+#
+# When building a random module like orchestrator, mvn lists 2 plugins as
+# prerequisites in the Reactor summary: bundle-plugin and config-class-plugin.
+#
+# It appears mvn is unable to resolve references to a plugin, if the same mvn
+# program builds the plugin, e.g. getting missing class errors.
+#
+# Therefore, we need to manually build all plugins first, then ensure we build
+# the rest of module without rebuilding the plugins (mvn's -rf). To be more
+# exact, mvn displays the order of modules it will build in the Reactor summary
+# - we need to build all modules up to and including all plugins in that list:
+# . (i.e. parent), annotations, scalalib, bundle-plugin, yolean, vespajlib,
+# configgen, and config-class-plugin. By using mvn -rf we can combine the
+# building of several of these into fewer commands to save time.
+#
+# After bootstrapping, the following mvn command must use -rf to avoid building
+# the plugins again: The 'java' mode runs mvn install with the correct -rf. So
+# to bootstrap the building of the orchestrator modules and all of its
+# dependencies, do: 'bootstrap.sh java -pl orchestrator'. To build everything
+# do 'bootstrap.sh java'.
+
+# Note: Why not just 'mvn_install -am -pl bundle-plugin'? Because on
+# Screwdriver (not locally), mvn fails to resolve bundle-plugin while parsing
+# pom files recursivelly. Therefore, shut off recursiveness -N until
+# bundle-plugin is built.
MODULES="
.
annotations
@@ -46,10 +71,13 @@ for module in $MODULES; do
(cd $module && mvn_install -N)
done
-mvn_install -am -pl config-class-plugin -rf configgen
+mvn_install -am -rf configgen -pl config-class-plugin
case "$MODE" in
java)
+ mvn_install -am -rf yolean -pl vespajlib
+ shift
+ mvn_install -rf config-lib -am "$@"
;;
full)
mvn_install -am -pl filedistributionmanager,jrt,linguistics,messagebus -rf yolean