Created
May 17, 2011 13:38
-
-
Save msiuts/976477 to your computer and use it in GitHub Desktop.
Jenkis Groovy Script to change Maven goals (from "install" to "deploy")
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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