1. #!groovy
    2. pipeline {
    3. agent { label 'Ebosstest01' }
    4. stages {
    5. stage('Build') {
    6. steps {
    7. sh '''
    8. export M2_HOME=/home/apache-maven-3.3.9_fee
    9. export PATH=$PATH:$M2_HOME/bin
    10. export JAVA_HOME=/usr/java/jdk1.7.0_79
    11. export CLASSPATH=.:$JAVA_HOME/lib.tools.jar
    12. export PATH=$JAVA_HOME/bin:$PATH
    13. cd ${WORKSPACE}/FJ_platform
    14. mvn clean deploy -Dmaven.test.skip=true
    15. '''
    16. }
    17. }
    18. stage('Upload') {
    19. steps {
    20. sh '''
    21. export EBOSS_Product=/home/eboss/EBOSS_Product
    22. mkdir -p ${WORKSPACE}/${JOB_NAME}/${BUILD_NUMBER} && find ${WORKSPACE}/FJ_platform/ -name "*.jar"|xargs -i cp {} ${WORKSPACE}/${JOB_NAME}/${BUILD_NUMBER}/
    23. scp -r ${WORKSPACE}/${JOB_NAME}/ jenkins@172.31.39.99:${EBOSS_Product}
    24. '''
    25. }
    26. }
    27. stage('Jacoco') {
    28. steps {
    29. echo "jacoco"
    30. jacoco execPattern: '**/jacoco.exec'
    31. }
    32. }
    33. stage('Sonarqube') {
    34. steps {
    35. sh'''
    36. export M2_HOME=/home/apache-maven-3.3.9_fee
    37. export PATH=$PATH:$M2_HOME/bin
    38. export JAVA_HOME=/usr/java/jdk1.8.0_201
    39. export CLASSPATH=.:$JAVA_HOME/lib.tools.jar
    40. export PATH=$JAVA_HOME/bin:$PATH
    41. cd ${WORKSPACE}/FJ_platform
    42. mvn sonar:sonar -Dsonar.host.url=http://112.35.68.176:9000 -Dsonar.login=dd0decced88e74d867e9a424c352c61058d40b23
    43. '''
    44. }
    45. }
    46. }
    47. }