Jenkinsfile 698 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. pipeline {
  2. agent any
  3. tools {
  4. jdk 'jdk17'
  5. // If you configured Maven as a Jenkins tool, add:
  6. // maven 'Maven3'
  7. }
  8. options {
  9. timestamps()
  10. disableConcurrentBuilds()
  11. }
  12. stages {
  13. stage('Checkout') {
  14. steps {
  15. checkout scm
  16. }
  17. }
  18. stage('Build') {
  19. steps {
  20. sh 'mvn -V -B clean package'
  21. }
  22. }
  23. stage('Deploy to Nexus') {
  24. steps {
  25. configFileProvider([configFile(fileId: 'maven-settings-nexus', variable: 'MAVEN_SETTINGS')]) {
  26. sh 'mvn -s "$MAVEN_SETTINGS" -V -B deploy'
  27. }
  28. }
  29. }
  30. }
  31. post {
  32. success {
  33. archiveArtifacts artifacts: 'target/mcMMO.jar', fingerprint: true
  34. }
  35. }
  36. }