Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIXED JENKINS-15935] Merge branch 'stable_mvn' of https://github.com…
…/vjuranek/jenkins into stable
- Loading branch information
Showing
37 changed files
with
1,381 additions
and
369 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,3 +36,5 @@ jenkins_*.build | |
jenkins_*.changes | ||
*.deb | ||
push-build.sh | ||
war/node_modules/ | ||
.java-version |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package jenkins.mvn; | ||
|
||
import hudson.Extension; | ||
import jenkins.model.GlobalConfiguration; | ||
import net.sf.json.JSONObject; | ||
|
||
import org.kohsuke.stapler.StaplerRequest; | ||
|
||
//as close as it gets to the global Maven Project configuration | ||
@Extension(ordinal = 50) | ||
public class GlobalMavenConfig extends GlobalConfiguration { | ||
private SettingsProvider settingsProvider; | ||
private GlobalSettingsProvider globalSettingsProvider; | ||
|
||
public GlobalMavenConfig() { | ||
load(); | ||
} | ||
|
||
@Override | ||
public boolean configure(StaplerRequest req, JSONObject json) throws FormException { | ||
req.bindJSON(this, json); | ||
return true; | ||
} | ||
|
||
public void setGlobalSettingsProvider(GlobalSettingsProvider globalSettingsProvider) { | ||
this.globalSettingsProvider = globalSettingsProvider; | ||
save(); | ||
} | ||
|
||
public void setSettingsProvider(SettingsProvider settingsProvider) { | ||
this.settingsProvider = settingsProvider; | ||
save(); | ||
} | ||
|
||
public GlobalSettingsProvider getGlobalSettingsProvider() { | ||
return globalSettingsProvider != null ? globalSettingsProvider : new DefaultGlobalSettingsProvider(); | ||
} | ||
|
||
public SettingsProvider getSettingsProvider() { | ||
return settingsProvider != null ? settingsProvider : new DefaultSettingsProvider(); | ||
} | ||
|
||
public static GlobalMavenConfig get() { | ||
return GlobalConfiguration.all().get(GlobalMavenConfig.class); | ||
} | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
core/src/main/resources/jenkins/mvn/GlobalMavenConfig/config.groovy
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package jenkins.mvn.GlobalMavenConfig; | ||
|
||
def f = namespace(lib.FormTagLib) | ||
|
||
f.section(title:_("Maven Configuration")) { | ||
f.dropdownDescriptorSelector(title:_("Default settings provider"), field:"settingsProvider") | ||
f.dropdownDescriptorSelector(title:_("Default global settings provider"), field:"globalSettingsProvider") | ||
} |
This file contains 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
Oops, something went wrong.
0dca811
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beware of apparent regression (CC @olamy): JENKINS-19251