[HUDSON-6080] Reconciled inconsistency between module root vs workspace usage for base in resolving alternate settings path in POM parsing vs actual Maven run

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@29304 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
abayer committed 2010-03-26 18:49:18 +00:00
1 parent 84791dbcea
commit f43ecdd93e
1 file changed
+5 -2
@@ -797,7 +797,9 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
private final String privateRepository;
private final String alternateSettings;
private final boolean nonRecursive;
// We're called against the module root, not the workspace, which can cause a lot of confusion.
private final String workspaceProper;
public PomParser(BuildListener listener, MavenInstallation mavenHome, MavenModuleSet project) {
// project cannot be shipped to the remote JVM, so all the relevant properties need to be captured now.
this.listener = listener;
@@ -806,6 +808,7 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
this.profiles = project.getProfiles();
this.properties = project.getMavenProperties();
this.nonRecursive = project.isNonRecursive();
this.workspaceProper = project.getLastBuild().getWorkspace().getRemote();
if (project.usesPrivateRepository()) {
this.privateRepository = project.getLastBuild().getWorkspace().child(".repository").getRemote();
} else {
@@ -847,7 +850,7 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
+ pom);
File settingsLoc = (alternateSettings == null) ? null
: new File(ws, alternateSettings);
: new File(workspaceProper, alternateSettings);
if ((settingsLoc != null) && (!settingsLoc.exists())) {
throw new AbortException(Messages.MavenModuleSetBuild_NoSuchAlternateSettings(settingsLoc.getAbsolutePath()));