build.sh 510 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. #export JAVA_HOME=xxx
  3. #export PATH=$JAVA_HOME/bin:$PATH
  4. #
  5. #export MAVEN_HOME=xxxx
  6. #export PATH=$MAVEN_HOME/bin:$PATH
  7. #
  8. module=tinyid-server
  9. env=$1
  10. if [ -z "$env" ]; then
  11. env='online'
  12. fi
  13. echo "build $env begin"
  14. mvn clean package -P$env -Dmaven.test.skip=true -f ../pom.xml
  15. ret=$?
  16. if [ $ret -ne 0 ];then
  17. echo "===== maven build failure ====="
  18. exit $ret
  19. else
  20. echo -n "===== maven build successfully! ====="
  21. fi
  22. rm -rf output
  23. mkdir output
  24. mv target/${module}-*.jar output
  25. cd output