I am developing a tool for myself using Swift and SwiftUI where I can retrieve student projects using git and then running Maven tests for the projects. The app is not sandboxed, since it is just for my personal use.
I use Process to launch git clone or git pull, and then get the commit log and parse the commit data to the app database. All this works just fine, I can see the app database table populated with repository commit data.
But when I do the same to execute Maven tests, and call
try process.run()
process.waitUntilExit()
The process never returns, unlike running git the same way. The only difference is the command executed and the arguments given to Process.
In the process view, I can see that there is a java child process running in my app, but it never (like in tens of minutes I have waited) completes. Running the same mvn test command...:
/opt/apache-maven-3.6.3/bin/mvn -Dstyle.color=never -Dtest=ReverseArrayRangeTests test
...from command line finishes in a couple of seconds.
While running the Maven command below executes just fine from Process:
/opt/apache-maven-3.6.3/bin/mvn -DskipTests -Dstyle.color=never package
In this case, I can see the output from the process while it builds the .jar package from the project.
Is there something special in running mvn test command, running Java in the child process, that it just does not work? Takes too much resources or something? macOS limiting what the child process can do, even though the app is not sandboxed?
I have also tried to Archive the app and run it outside of Xcode debugging, but that doesn't change anything.
My previous solution was to run the tests separately in Terminal using a shell script, saving the test results to a log file the app then read and parsed. But I'd like to do everything within the same GUI app, if possible. Any ideas?