public class MavenCommandRunner extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
MAVEN_DOWNLOAD_DESTINATION |
static String |
MAVEN_PATH |
static String |
MAVEN_URL |
| Constructor and Description |
|---|
MavenCommandRunner() |
| Modifier and Type | Method and Description |
|---|---|
static void |
downloadMavenIfNotExist()
download maven if path is not found
|
protected static ArrayList<String> |
excuteCommand(String command)
run command based on windows or mac/linux environment
|
static void |
executeMavenCommandEmbedded() |
static String |
getRootDir()
get current project root directory, where pom.xml is
|
protected static boolean |
isMac()
returns true if OS is mac
|
protected static boolean |
isUnix()
returns true if OS is unix or linux
|
protected static boolean |
isWindows()
returns true if OS is windows
|
static void |
main(String[] args)
process of setting maven:
1.
|
static void |
setMavenPath()
Maven home: /usr/local/Cellar/maven/3.6.2/libexec
get path of maven from "mvn -version"
|
static void |
setMavenPathFromConfig()
set maven path if set from config file
|
static File |
verifyAndGetMavenHomePath()
verify maven bin path exists in maven path or parent folder
set maven path to the correct value
|
public static String MAVEN_PATH
public static String MAVEN_URL
public static String MAVEN_DOWNLOAD_DESTINATION
public static void main(String[] args) throws Exception
args - Exceptionpublic static void setMavenPathFromConfig()
public static void downloadMavenIfNotExist()
throws Exception
public static void setMavenPath()
results - protected static ArrayList<String> excuteCommand(String command)
command - protected static boolean isMac()
protected static boolean isWindows()
protected static boolean isUnix()
public static File verifyAndGetMavenHomePath()
public static String getRootDir()
public static void executeMavenCommandEmbedded()
Copyright © 2019. All rights reserved.