Jenkinsfile 1.5 KB

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