install-plugin.sh 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/bin/bash
  2. #
  3. # Licensed to the Apache Software Foundation (ASF) under one or more
  4. # contributor license agreements. See the NOTICE file distributed with
  5. # this work for additional information regarding copyright ownership.
  6. # The ASF licenses this file to You under the Apache License, Version 2.0
  7. # (the "License"); you may not use this file except in compliance with
  8. # the License. You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. #
  18. #This script is used to download the connector plug-ins required during the running process.
  19. #All are downloaded by default. You can also choose what you need.
  20. #You only need to configure the plug-in name in config/plugin_config.
  21. # get seatunnel home
  22. SEATUNNEL_HOME=$(cd $(dirname $0);cd ../;pwd)
  23. # connector default version is 2.3.1, you can also choose a custom version. eg: 2.1.2: sh install-plugin.sh 2.1.2
  24. version=2.3.1
  25. if [ -n "$1" ]; then
  26. version="$1"
  27. fi
  28. echo "Install hadoop shade jar, usage version is ${version}"
  29. ${SEATUNNEL_HOME}/mvnw dependency:get -DgroupId=org.apache.seatunnel -Dclassifier=optional -DartifactId=seatunnel-hadoop3-3.1.4-uber -Dversion=${version} -Ddest=${SEATUNNEL_HOME}/lib
  30. echo "Install SeaTunnel connectors plugins, usage version is ${version}"
  31. # create the connectors directory
  32. if [ ! -d ${SEATUNNEL_HOME}/connectors ];
  33. then
  34. mkdir ${SEATUNNEL_HOME}/connectors
  35. echo "create connectors directory"
  36. fi
  37. # create the seatunnel connectors directory (for v2)
  38. if [ ! -d ${SEATUNNEL_HOME}/connectors/seatunnel ];
  39. then
  40. mkdir ${SEATUNNEL_HOME}/connectors/seatunnel
  41. echo "create seatunnel connectors directory"
  42. fi
  43. while read line; do
  44. if [ ${line:0:1} != "-" ] && [ ${line:0:1} != "#" ]
  45. then
  46. echo "install connector : " $line
  47. ${SEATUNNEL_HOME}/mvnw dependency:get -DgroupId=org.apache.seatunnel -DartifactId=${line} -Dversion=${version} -Ddest=${SEATUNNEL_HOME}/connectors/seatunnel
  48. fi
  49. done < ${SEATUNNEL_HOME}/config/plugin_config