Skip to content

Instantly share code, notes, and snippets.

@msiuts
Created May 17, 2011 13:38
Show Gist options
  • Select an option

  • Save msiuts/976477 to your computer and use it in GitHub Desktop.

Select an option

Save msiuts/976477 to your computer and use it in GitHub Desktop.
Jenkis Groovy Script to change Maven goals (from "install" to "deploy")
import hudson.model.*
import hudson.maven.*
import hudson.tasks.*
for (item in Hudson.instance.items) {
if (item instanceof hudson.maven.MavenModuleSet) {
println("JOB : "+item.name);
if (item.getUserConfiguredGoals() != null && item.getUserConfiguredGoals().contains("install")) {
println("Deploy : "+item.name);
goals = item.getUserConfiguredGoals()
goals = goals.replace("install", "deploy")
item.setGoals(goals)
item.save()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment