[FIXED HUDSON-2335] Validate Maven installation directory just like Ant installation

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@12048 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
jjasper committed 2008-09-06 19:52:12 +00:00
1 parent 28c432f230
commit 0fca64b08e
9 files changed
+19 -3

No files matched your search

+10 -2
View File
@@ -51,6 +51,9 @@ public class Maven extends Builder {
* Identifies {@link MavenInstallation} to be used.
*/
private final String mavenName;
private final static String MAVEN_1_INSTALLATION_COMMON_FILE = "bin/maven";
private final static String MAVEN_2_INSTALLATION_COMMON_FILE = "bin/mvn";
@DataBoundConstructor
public Maven(String targets,String name) {
@@ -257,8 +260,13 @@ public class Maven extends Builder {
return;
}
// I couldn't come up with a simple logic to test for a maven installation
// there seems to be just too much difference between m1 and m2.
File maven1File = new File(f,MAVEN_1_INSTALLATION_COMMON_FILE);
File maven2File = new File(f,MAVEN_2_INSTALLATION_COMMON_FILE);
if(!maven1File.exists() && !maven2File.exists()) {
error(Messages.Maven_NotMavenDirectory(f));
return;
}
ok();
}