Jenkinsfile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. node {
  2. try
  3. {
  4. // Mark the code checkout 'stage'....
  5. stage 'Checkout'
  6. checkout scm
  7. stage ('Clean'){
  8. withMaven(mavenLocalRepo: '.repository', mavenSettingsFilePath: "${env.MVN_SETTINGS_PATH}") {
  9. // Run the maven build
  10. sh "mvn clean -Dtycho.mode=maven -fn -f DSL_SemanticAdaptation/pom.xml"
  11. }}
  12. stage ('Package install'){
  13. withMaven(mavenLocalRepo: '.repository', mavenSettingsFilePath: "${env.MVN_SETTINGS_PATH}") {
  14. // Run the maven build
  15. sh "mvn install -f DSL_SemanticAdaptation/pom.xml"
  16. step([$class: 'ArtifactArchiver', artifacts: '**/target/*.jar', fingerprint: true])
  17. step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*.xml'])
  18. // step([$class: 'JacocoPublisher'])
  19. step([$class: 'TasksPublisher', canComputeNew: false, defaultEncoding: '', excludePattern: '', healthy: '', high: 'FIXME', ignoreCase: true, low: '', normal: 'TODO', pattern: '', unHealthy: ''])
  20. }}
  21. } catch (any) {
  22. currentBuild.result = 'FAILURE'
  23. throw any //rethrow exception to prevent the build from proceeding
  24. } finally {
  25. stage('Reporting'){
  26. // Notify on build failure using the Email-ext plugin
  27. emailext(body: '${DEFAULT_CONTENT}', mimeType: 'text/html',
  28. replyTo: '$DEFAULT_REPLYTO', subject: '${DEFAULT_SUBJECT}',
  29. to: emailextrecipients([[$class: 'CulpritsRecipientProvider'],
  30. [$class: 'RequesterRecipientProvider']]))
  31. }
  32. }
  33. }