I want to execute a maven command (mvn test) from javascript code but it doesn't work here's the code of my Servlet ;
out.println("<script type='text/javascript'> " +
"function f(){ try{var wsh = new ActiveXObject('WScript.Shell'); " +
"wsh.Run('cd C:/Users/Amira/junoWorkspace/TestProjectUI');" +
"wsh.Run('mvn -Dtest=MyClassTest test') } catch(err){} } </script> ");
out.println("<body><input type='submit' value='Execute Test' onclick='f()'> </body>");
So any idea please if there's a better solution please mention it Cheers