From d11a5fe15eab7a02f86d032a7c1c0c28f8fcc6b6 Mon Sep 17 00:00:00 2001 From: Bruno Thomas Date: Fri, 28 Feb 2020 17:25:13 +0000 Subject: [PATCH] [#360] build : remove models from jar --- .circleci/config.yml | 10 ++---- Makefile | 4 +-- datashare-dist/pom.xml | 34 +++++++++++++------- datashare-dist/src/main/docker/entrypoint.sh | 2 +- datashare-nlp/datashare-nlp-ixapipe/pom.xml | 1 - 5 files changed, 28 insertions(+), 23 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d25b0b5a2..6c8ccc00d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,11 +58,7 @@ jobs: - run: mvn -pl datashare-db liquibase:update - run: mvn test - run: mvn -Dmaven.test.skip=true package - - run: - name: copy jar into dist dir - command: | - mkdir datashare-dist/target/datashare-dist-$CIRCLE_TAG/lib - cp datashare-dist/target/datashare-dist-$CIRCLE_TAG.jar datashare-dist/target/datashare-dist-$CIRCLE_TAG/lib/ + - persist_to_workspace: root: /tmp/datashare paths: @@ -147,8 +143,8 @@ jobs: - run: name: build and push docker image command: | - cp -a /tmp/datashare/dist/ /tmp/datashare/datashare-dist/target/datashare-dist-$CIRCLE_TAG/app - docker build -t icij/datashare:${CIRCLE_TAG} /tmp/datashare/datashare-dist/target/datashare-dist-$CIRCLE_TAG/ + cp -a /tmp/datashare/dist/ /tmp/datashare/datashare-dist/target/datashare-dist-$CIRCLE_TAG-all/app + docker build -t icij/datashare:${CIRCLE_TAG} /tmp/datashare/datashare-dist/target/datashare-dist-$CIRCLE_TAG-all/ docker login -u ${DOCKER_USER} -p ${DOCKER_PASS} docker push icij/datashare:${CIRCLE_TAG} diff --git a/Makefile b/Makefile index 99bf0f1c0..875aa903b 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ VERSION = $(shell cat pom.xml | grep '[0-9.]\+' | sed 's/\([0-9.]\+\)<\/version>/\1/g' | tr -d '[:space:]') -DIST_TARGET=datashare-dist/target/datashare-dist-$(VERSION) +DIST_TARGET=datashare-dist/target/datashare-dist-$(VERSION)-all PATH_TO_APP_DIST=../datashare-client/dist/ $(DIST_TARGET): dist @@ -25,8 +25,6 @@ release: docker: $(DIST_TARGET) cp -a $(PATH_TO_APP_DIST) $(DIST_TARGET)/app || exit 1 - mkdir -p $(DIST_TARGET)/lib - cp datashare-dist/target/*.jar $(DIST_TARGET)/lib/ docker build -t icij/datashare:$(VERSION) $(DIST_TARGET) unit: diff --git a/datashare-dist/pom.xml b/datashare-dist/pom.xml index f051e5594..e31cb6b49 100644 --- a/datashare-dist/pom.xml +++ b/datashare-dist/pom.xml @@ -11,7 +11,7 @@ datashare-dist - pom + jar @@ -84,18 +84,30 @@ - maven-assembly-plugin + org.apache.maven.plugins + maven-shade-plugin + 3.2.2 - false - - - org.icij.datashare.Main - - - - jar-with-dependencies - + all + true + + + + .dat + + + + + package + + shade + + + + + + maven-assembly-plugin package diff --git a/datashare-dist/src/main/docker/entrypoint.sh b/datashare-dist/src/main/docker/entrypoint.sh index ba337d559..753dcf481 100755 --- a/datashare-dist/src/main/docker/entrypoint.sh +++ b/datashare-dist/src/main/docker/entrypoint.sh @@ -7,6 +7,6 @@ if [ "$1" = 'sh' ]; then exec "$@" else - CLASSPATH=$(find /home/datashare/lib -name "*.jar") + CLASSPATH=$(find /home/datashare/lib/ -name '*.jar' | xargs | sed 's/ /:/g') exec java "${DS_JAVA_OPTS}" -DPROD_MODE=true -cp "/home/datashare/dist/:${CLASSPATH}" ${MAIN_CLASS} "$@" fi diff --git a/datashare-nlp/datashare-nlp-ixapipe/pom.xml b/datashare-nlp/datashare-nlp-ixapipe/pom.xml index 7b5b3e1af..9f289569f 100644 --- a/datashare-nlp/datashare-nlp-ixapipe/pom.xml +++ b/datashare-nlp/datashare-nlp-ixapipe/pom.xml @@ -97,7 +97,6 @@ -