提交 b97ad462 编写于 作者: O Olivier Lamy

really fix use of env var in pols tru ${env.xxxx}

上级 b5290ef0
......@@ -661,7 +661,7 @@ public final class MavenModuleSet extends AbstractMavenProject<MavenModuleSet,Ma
* Check for "-N" or "--non-recursive" in the Maven goals/options.
*/
public boolean isNonRecursive() {
return checkMavenOption("-N", "--non-recursive");
return checkMavenOption("-N", "--non-recursive");
}
/**
......
......@@ -43,9 +43,12 @@ import hudson.model.Computer;
import hudson.model.Environment;
import hudson.model.Fingerprint;
import hudson.model.Hudson;
import hudson.model.ParameterDefinition;
import hudson.model.ParametersAction;
import hudson.model.ParametersDefinitionProperty;
import hudson.model.Result;
import hudson.model.Run;
import hudson.model.StringParameterDefinition;
import hudson.model.TaskListener;
import hudson.remoting.Channel;
import hudson.remoting.VirtualChannel;
......@@ -1009,6 +1012,15 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
this.rootPOM = project.getRootPOM();
this.profiles = project.getProfiles();
this.properties = project.getMavenProperties();
ParametersDefinitionProperty parametersDefinitionProperty = project.getProperty( ParametersDefinitionProperty.class );
if (parametersDefinitionProperty != null && parametersDefinitionProperty.getParameterDefinitions() != null) {
for (ParameterDefinition parameterDefinition : parametersDefinitionProperty.getParameterDefinitions()) {
// those must used as env var
if (parameterDefinition instanceof StringParameterDefinition) {
this.properties.put( "env." + parameterDefinition.getName(), ((StringParameterDefinition)parameterDefinition).getDefaultValue() );
}
}
}
this.nonRecursive = project.isNonRecursive();
this.workspaceProper = project.getLastBuild().getWorkspace().getRemote();
if (project.usesPrivateRepository()) {
......
package hudson.maven;
import hudson.Launcher;
import hudson.maven.MavenBuildTest.TestReporter;
import hudson.model.BuildListener;
import hudson.model.ParametersDefinitionProperty;
import hudson.model.Result;
......
......@@ -128,7 +128,7 @@ public class MavenBuildTest extends HudsonTestCase {
}
@Email("https://groups.google.com/d/msg/hudson-users/Xhw00UopVN0/FA9YqDAIsSYJ")
public void testMavenVersionWithEnvVar() throws Exception {
public void testMavenWithDependencyVersionInEnvVar() throws Exception {
MavenModuleSet m = createMavenProject();
MavenInstallation mavenInstallation = configureDefaultMaven();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册