def myFile= new File("/tmp/DSL45/configuration.xml") def parser=new XmlSlurper().parseText(myFile.text); def allModule=parser.module.each { def projectName= it.name as String def sourceCodeType=it.source.@type def versionCode = it.source.@version def URLSource=it.source as String def mvnGoal= it.goal as String def hasSonar= it.sonar as String def mail = it.mail as String def myrepositoryId = it.deploy.RepositoryId as String def repositoryURL = it.deploy.RepositoryURL as String def nightly = it.nightly as String def cron_node = it.cron as String def j_name = 'DSL45_'+projectName if (versionCode == '4') { j_name = 'DSL45_'+projectName } if (versionCode == '5') { j_name = 'DSL5_'+projectName } mavenJob(j_name) { scm { svn { location(URLSource) checkoutStrategy(SvnCheckoutStrategy.CHECKOUT) } } triggers { scm('H/10 * * * *') snapshotDependencies(true) } goals(mvnGoal) logRotator { numToKeep(2) artifactNumToKeep(1) } publishers { deployArtifacts { repositoryUrl (repositoryURL) repositoryId (myrepositoryId) uniqueVersion (true) evenIfUnstable (true) } } configure { project -> project / 'publishers' / 'jenkins.plugins.slack.SlackNotifier'(plugin: 'slack@2.2"') { 'baseUrl'() 'teamDomain'() 'authToken'() 'authTokenCredentialId'() 'botUser'(false) 'room'() 'startNotification'(false) 'notifySuccess'(false) 'notifyAborted'(false) 'notifyNotBuilt'(false) 'notifyUnstable'(true) 'notifyRegression'(false) 'notifyFailure'(true) 'notifyBackToNormal'(true) 'notifyRepeatedFailure'(false) 'includeTestSummary'(false) 'includeFailedTests'(false) 'commitInfoChoice'('NONE') 'includeCustomMessage'(false) 'customMessage'() } } } }