From 257c56113404200fd9559b9cca1a0b343c113f6a Mon Sep 17 00:00:00 2001 From: Andrii Rosa Date: Mon, 19 Mar 2018 17:19:15 -0400 Subject: [PATCH] Add maven flag to create tests jar with dependencies Sometimes it is usefull to be able to run a test or a benchmark on the other machine than a development one. For example it is prefered to run benchmarks on a solid desktop or on a server machine to overcome overheating deviations in benchmark execution time. Since most of the modules have complex dependency tree it is very hard to copy every dependency to the remote server and write a cmd line that has all the dependencies included. This commit is supposed to address this issue. Now we can tell maven to assemble an uber(fat) jar that includes the entire "test" scope classpath for a particular module. For example after running: ./mvnw clean install -P tests-with-dependencies -pl presto-geospatial The uber jar that contains the entire class path of the "test" scope of the "presto-geospatial" module is created and placed to that modules target directory: ./presto-geospatial/target/presto-geospatial-0.197-SNAPSHOT-tests-with-dependencies.jar Now using this jar we can easly run any benchmark from that module via the command line: java \ -cp ./presto-geospatial/target/presto-geospatial-*-tests-with-dependencies.jar \ com.facebook.presto.plugin.geospatial.BenchmarkSTIntersects --- pom.xml | 43 ++++++++++++++++++++++++ src/assembly/tests-with-dependencies.xml | 37 ++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 src/assembly/tests-with-dependencies.xml diff --git a/pom.xml b/pom.xml index 2f8b65b355ae5..966eb1394164b 100644 --- a/pom.xml +++ b/pom.xml @@ -1201,4 +1201,47 @@ + + + + tests-with-dependencies + + + + + maven-assembly-plugin + + ${air.main.basedir}/src/assembly/tests-with-dependencies.xml + + + + make-assembly + package + + single + + + + + + + + diff --git a/src/assembly/tests-with-dependencies.xml b/src/assembly/tests-with-dependencies.xml new file mode 100644 index 0000000000000..0138a4861ad69 --- /dev/null +++ b/src/assembly/tests-with-dependencies.xml @@ -0,0 +1,37 @@ + + tests-with-dependencies + + jar + + false + + + / + true + true + + + META-INF/** + + + test + + + + + ${project.build.directory}/classes + / + true + + META-INF/** + + + + ${project.build.directory}/test-classes + / + true + + +