Skip to content
Advertisement

How to run a mvn command from a java program?

I am building a Java program for automating a procedure in my server side. Normally I cd to Desktop/GIT/ and use this maven command “mvn integration-test -DskipTests -P interactive -e”.

I am building a java program and I am trying to run that command line but so far I wasn’t successful.

So far, here is the code:

JavaScript

Advertisement

Answer

I managed to run the mvn using the following code: (I use this command: Runtime.getRuntime().exec(cmd);)

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement