How to execute shell commands with Maven?

 


Add below configuration in your pom.xml file to execute shell commands with Maven:

<plugin>
  <artifactId>exec-maven-plugin</artifactId>
  <groupId>org.codehaus.mojo</groupId>
  <executions>
    <execution><!-- Run our version calculation script -->
      <id>Version Calculation</id>
      <phase>generate-sources</phase>
      <goals>
        <goal>exec</goal>
      </goals>
      <configuration>
        <executable>${basedir}/scripts/calculate-version.sh</executable>
      </configuration>
    </execution>
  </executions>
</plugin>

 


Related #tags:     #pom.xml     #maven    

Related questions




Looking for change? Click below to prepare for technical interview.


Technical Interview Questions