Skip to content

Commit

Permalink
[JENKINS-37613] Rename mavenInstallation to maven (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarolobato committed Aug 25, 2016
1 parent 156d194 commit 66ce6f4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
Expand Up @@ -54,7 +54,7 @@ public class WithMavenStep extends AbstractStepImpl {

private String mavenSettingsConfig;
private String mavenSettingsFilePath;
private String mavenInstallation;
private String maven;
private String mavenOpts;
private String jdk;
private String mavenLocalRepo;
Expand Down Expand Up @@ -82,13 +82,13 @@ public void setMavenSettingsFilePath(String mavenSettingsFilePath) {
this.mavenSettingsFilePath = mavenSettingsFilePath;
}

public String getMavenInstallation() {
return mavenInstallation;
public String getMaven() {
return maven;
}

@DataBoundSetter
public void setMavenInstallation(String mavenInstallation) {
this.mavenInstallation = mavenInstallation;
public void setMaven(String maven) {
this.maven = maven;
}

public String getMavenOpts() {
Expand Down Expand Up @@ -150,7 +150,7 @@ private Maven.DescriptorImpl getMavenDescriptor() {
}

@Restricted(NoExternalUse.class) // Only for UI calls
public ListBoxModel doFillMavenInstallationItems() {
public ListBoxModel doFillMavenItems() {
ListBoxModel r = new ListBoxModel();
r.add("--- Use system default Maven ---",null);
for (MavenInstallation installation : getMavenDescriptor().getInstallations()) {
Expand Down
Expand Up @@ -58,7 +58,6 @@
import com.cloudbees.plugins.credentials.common.StandardUsernameCredentials;
import com.google.inject.Inject;

import antlr.Utils;
import hudson.AbortException;
import hudson.EnvVars;
import hudson.FilePath;
Expand Down Expand Up @@ -120,7 +119,7 @@ public boolean start() throws Exception {
console = listener.getLogger();

if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, "Maven Installation: {0}", step.getMavenInstallation());
LOGGER.log(Level.FINE, "Maven: {0}", step.getMaven());
LOGGER.log(Level.FINE, "Jdk: {0}", step.getJdk());
LOGGER.log(Level.FINE, "MavenOpts: {0}", step.getMavenOpts());
LOGGER.log(Level.FINE, "Settings Config: {0}", step.getMavenSettingsConfig());
Expand Down Expand Up @@ -179,7 +178,7 @@ private void setupJDK() throws AbortException, IOException, InterruptedException
if (!withContainer) {
jdk = Jenkins.getActiveInstance().getJDK(step.getJdk());
if (jdk == null) {
throw new AbortException("Could not find the JDK: " + step.getJdk() + ". Make sure it is configured on the Global Tool Configuration page");
throw new AbortException("Could not find the JDK installation: " + step.getJdk() + ". Make sure it is configured on the Global Tool Configuration page");
}
Node node = getComputer().getNode();
if (node == null){
Expand All @@ -188,7 +187,7 @@ private void setupJDK() throws AbortException, IOException, InterruptedException
jdk = jdk.forNode(node, listener).forEnvironment(env);
jdk.buildEnvVars(envOverride);
} else { // see #detectWithContainer()
LOGGER.log(Level.FINE, "Ignoring JDK Installation parameter: {0}", step.getJdk());
LOGGER.log(Level.FINE, "Ignoring JDK installation parameter: {0}", step.getJdk());
console.println(
"WARNING: Step running within docker.image() tool installations are not available see https://issues.jenkins-ci.org/browse/JENKINS-36159. You have specified a JDK installation, which will be ignored.");
}
Expand Down Expand Up @@ -239,7 +238,7 @@ private String obtainMavenExec() throws AbortException, IOException, Interrupted

LOGGER.fine("Setting up maven");

String mavenName = step.getMavenInstallation();
String mavenName = step.getMaven();

if (!StringUtils.isEmpty(mavenName)) {
if (!withContainer) {
Expand Down
@@ -1,7 +1,7 @@
package org.jenkinsci.plugins.pipeline.maven.WithMavenStep
def f = namespace(lib.FormTagLib) as lib.FormTagLib

f.entry(field: 'mavenInstallation', title: _('Maven Installation')) {
f.entry(field: 'maven', title: _('Maven')) {
f.select()
}

Expand Down

0 comments on commit 66ce6f4

Please sign in to comment.