
org.walkmod.maven.providers.MavenCommand Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of walkmod-maven-plugin Show documentation
Show all versions of walkmod-maven-plugin Show documentation
Walkmod plugin to resolve a maven user classpath and provide it to code transformations
The newest version!
package org.walkmod.maven.providers;
import java.io.File;
/**
* Created by raquelpau on 3/3/17.
*/
public class MavenCommand {
public static String getCommand(){
return getCommand(System.getenv("M2_HOME"));
}
public static String getBinaryFileName(){
String os = System.getProperty("os.name").toLowerCase();
String command = "mvn";
if (os.contains("win")) {
command += ".cmd";
}
return command;
}
public static String getCommand(String mavenHome){
if(mavenHome == null){
return getBinaryFileName();
}
if(!mavenHome.endsWith(File.separator)){
mavenHome+=File.separator;
}
return mavenHome+"bin"+ File.separator+getBinaryFileName();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy