Hi i have a shell script named script .sh that create maven project having parent pom and multiple modules under it as follows:
#!/bin/bash
mvn archetype:generate -DgroupId="com.low.co" -DartifactId="tool-release" -DarchetypeGroupId=org.codehaus.mojo.archetypes -DarchetypeArtifactId=pom-root -DarchetypeVersion=RELEASE
cd yeti-release
mvn archetype:generate -DgroupId="com.low.cp" -DartifactId="tool-api" -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=RELEASE
mvn archetype:generate -DgroupId="com.low.cp" -DartifactId="tool-impl" -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=RELEASE
mvn archetype:generate -DgroupId="com.low.cp" -DartifactId="tool-rest" -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=RELEASE
mvn archetype:generate -DgroupId="com.low.cp" -DartifactId="tool-service" -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=RELEASE
I want to run this script from java code i am using mac osx i tried every thing my code that is opening this script is as follows:
final File scriptDirectory = new File("src/main/resources/");
final String shellScript = "./script.sh";
ProcessBuilder pb = new ProcessBuilder();
pb.command("/bin/bash","-e",shellScript);
pb.directory(scriptDirectory);
p=pb.start();
when i change script.sh it is not showing console nor executing any of the commands in the shell script
any suggestions pls