diff --git a/bin/bookkeeper b/bin/bookkeeper index 93ef29b4b702d9..2290960c566908 100755 --- a/bin/bookkeeper +++ b/bin/bookkeeper @@ -7,9 +7,9 @@ # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -121,7 +121,10 @@ add_maven_deps_to_classpath() { f="${BK_HOME}/distribution/server/target/classpath.txt" if [ ! -f "${f}" ] then - ${MVN} -f "${BK_HOME}/pom.xml" dependency:build-classpath -Dmdep.outputFile="${f}" &> /dev/null + ( + cd "${BK_HOME}" + ${MVN} -pl distribution/server generate-sources &> /dev/null + ) fi BOOKIE_CLASSPATH=${CLASSPATH}:`cat "${f}"` } diff --git a/bin/function-localrunner b/bin/function-localrunner index 3b4ab042401f20..da5387d333d752 100755 --- a/bin/function-localrunner +++ b/bin/function-localrunner @@ -68,7 +68,10 @@ add_maven_deps_to_classpath() { f="${PULSAR_HOME}/distribution/server/target/classpath.txt" if [ ! -f "${f}" ] then - ${MVN} -f "${PULSAR_HOME}/pom.xml" dependency:build-classpath -DincludeScope=compile -Dmdep.outputFile="${f}" &> /dev/null + ( + cd "${PULSAR_HOME}" + ${MVN} -pl distribution/server generate-sources &> /dev/null + ) fi PULSAR_CLASSPATH=${CLASSPATH}:`cat "${f}"` } diff --git a/bin/pulsar b/bin/pulsar index 829f33e33f10f4..ff41b64dc77587 100755 --- a/bin/pulsar +++ b/bin/pulsar @@ -191,7 +191,10 @@ add_maven_deps_to_classpath() { f="${PULSAR_HOME}/distribution/server/target/classpath.txt" if [ ! -f "${f}" ] then - ${MVN} -f "${PULSAR_HOME}/pom.xml" dependency:build-classpath -DincludeScope=compile -Dmdep.outputFile="${f}" &> /dev/null + ( + cd "${PULSAR_HOME}" + ${MVN} -pl distribution/server generate-sources &> /dev/null + ) fi PULSAR_CLASSPATH=${CLASSPATH}:`cat "${f}"` } diff --git a/bin/pulsar-admin-common.sh b/bin/pulsar-admin-common.sh index 0ccfc709858778..46ab6d8c75818c 100755 --- a/bin/pulsar-admin-common.sh +++ b/bin/pulsar-admin-common.sh @@ -65,7 +65,10 @@ add_maven_deps_to_classpath() { f="${PULSAR_HOME}/distribution/server/target/classpath.txt" if [ ! -f "${f}" ] then - ${MVN} -f "${PULSAR_HOME}/pom.xml" dependency:build-classpath -DincludeScope=compile -Dmdep.outputFile="${f}" &> /dev/null + ( + cd "${PULSAR_HOME}" + ${MVN} -pl distribution/server generate-sources &> /dev/null + ) fi PULSAR_CLASSPATH=${CLASSPATH}:`cat "${f}"` } diff --git a/bin/pulsar-client b/bin/pulsar-client index 122230a84db61f..dcee2e3b646a99 100755 --- a/bin/pulsar-client +++ b/bin/pulsar-client @@ -7,9 +7,9 @@ # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -41,14 +41,14 @@ else fi # exclude tests jar -RELEASE_JAR=`ls $PULSAR_HOME/pulsar-*.jar 2> /dev/null | grep -v tests | tail -1` +RELEASE_JAR=`ls $PULSAR_HOME/pulsar-*.jar 2> /dev/null | grep -v tests | tail -1` if [ $? == 0 ]; then PULSAR_JAR=$RELEASE_JAR fi # exclude tests jar BUILT_JAR=`ls $PULSAR_HOME/pulsar-client-tools/target/pulsar-*.jar 2> /dev/null | grep -v tests | tail -1` -if [ $? != 0 ] && [ ! -e "$PULSAR_JAR" ]; then +if [ $? != 0 ] && [ ! -e "$PULSAR_JAR" ]; then echo "\nCouldn't find pulsar jar."; echo "Make sure you've run 'mvn package'\n"; exit 1; @@ -61,14 +61,17 @@ add_maven_deps_to_classpath() { if [ "$MAVEN_HOME" != "" ]; then MVN=${MAVEN_HOME}/bin/mvn fi - + # Need to generate classpath from maven pom. This is costly so generate it # and cache it. Save the file into our target dir so a mvn clean will get # clean it up and force us create a new one. f="${PULSAR_HOME}/distribution/server/target/classpath.txt" if [ ! -f "${f}" ] then - ${MVN} -f "${PULSAR_HOME}/pom.xml" dependency:build-classpath -Dmdep.outputFile="${f}" &> /dev/null + ( + cd "${PULSAR_HOME}" + ${MVN} -pl distribution/server generate-sources &> /dev/null + ) fi PULSAR_CLASSPATH=${CLASSPATH}:`cat "${f}"` } diff --git a/bin/pulsar-perf b/bin/pulsar-perf index 9bc5c0cf7c0414..aa6e67a9942de9 100755 --- a/bin/pulsar-perf +++ b/bin/pulsar-perf @@ -74,7 +74,10 @@ add_maven_deps_to_classpath() { f="${PULSAR_HOME}/distribution/server/target/classpath.txt" if [ ! -f "${f}" ] then - ${MVN} -f "${PULSAR_HOME}/pom.xml" dependency:build-classpath -Dmdep.outputFile="${f}" &> /dev/null + ( + cd "${PULSAR_HOME}" + ${MVN} -pl distribution/server generate-sources &> /dev/null + ) fi PULSAR_CLASSPATH=${CLASSPATH}:`cat "${f}"` } diff --git a/site2/tools/docker-build-site.sh b/site2/tools/docker-build-site.sh index d6022d3e1bc030..a213a2491ca756 100755 --- a/site2/tools/docker-build-site.sh +++ b/site2/tools/docker-build-site.sh @@ -44,4 +44,4 @@ CROWDIN_DOCUSAURUS_API_KEY=${CROWDIN_DOCUSAURUS_API_KEY:-UNSET} DOCKER_CMD="docker run -i -e CI_USER=$CI_USER -e CI_GROUP=$CI_GROUP -v $HOME/.m2:/root/.m2 -e CROWDIN_DOCUSAURUS_PROJECT_ID=${CROWDIN_DOCUSAURUS_PROJECT_ID} -e CROWDIN_DOCUSAURUS_API_KEY=${CROWDIN_DOCUSAURUS_API_KEY} -v $ROOT_DIR:/pulsar $IMAGE" -$DOCKER_CMD bash -l -c 'cd /pulsar && /pulsar/site2/tools/build-site.sh' +$DOCKER_CMD bash -l -c 'cd /pulsar && rm -f distribution/server/target/classpath.txt && /pulsar/site2/tools/build-site.sh'