Running a shell script through the pom file.

Isuru Uyanage
1 min readSep 16, 2019

When you implement a build system for a project, you may come across your project has used multiple structures which may be non java. At that point you may not have any other option than running a shell script via the pom file.

You can place the pom file inside the resource folder after the maven project is created.

You can use the following plugin to run the shell script. Assume that your shell script resides in <Project-home>/resource folder is run.sh.

<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.6.0</version> <executions>  <execution>   <id>my-exec</id>   <phase>pre-integration-test</phase>  <goals>   <goal>exec</goal>  </goals>  </execution> </executions> <configuration>  <executable>${project-home}/resources/run.sh</executable> </configuration></plugin>

--

--