build.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/usr/bin/env bash
  2. case $1 in
  3. exec)
  4. echo "mvn -Dexec.executable='echo' -Dexec.args='{project.artifactId}' exec:exec -q"
  5. mvn -Dexec.executable='echo' -Dexec.args=$1' ${project.artifactId}' exec:exec -q
  6. ;;
  7. checkstyle)
  8. echo "mvn checkstyle:checkstyle > check.log"
  9. mvn checkstyle:checkstyle > check.log
  10. ;;
  11. dependency)
  12. echo "mvn dependency:tree > dep.log"
  13. mvn dependency:tree > dep.log
  14. ;;
  15. docker)
  16. echo "mvn clean package -Dmaven.test.skip=true -Pdocker"
  17. mvn clean package -Dmaven.test.skip=true
  18. ;;
  19. test)
  20. echo "mvn clean package -Ptest"
  21. java -version
  22. mvn clean package -Dmaven.test.skip=true
  23. ;;
  24. sonarqube)
  25. echo "mvn clean package && sonar-scanner"
  26. export JAVA_HOME=$JAVA_11_HOME
  27. export PATH="$JAVA_11_HOME/bin:$PATH"
  28. java -version
  29. if [ $# -eq 6 ]; then
  30. mvn clean package -Dmaven.test.skip=true -Dmaven.compiler.source=11 -Dmaven.compiler.target=11 \
  31. $3 $4 $5 $6 \
  32. -Dsonar.login="admin" -Dsonar.password="admin1@3"
  33. fi
  34. ;;
  35. *)
  36. echo "mvn clean package -Dmaven.test.skip=true -Prelease"
  37. java -version
  38. mvn clean package -Dmaven.test.skip=true
  39. ;;
  40. esac