Getting this error in child pom.xml
for module libs
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (install-uum) on project libs: Command execution failed. Cannot run program "mvn" (in directory "D:\xyz\build\project_name\Build\app_name\libs"): CreateProcess error=2, The system cannot find the file specified
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<inherited>false</inherited>
<executions>
<execution>
<id>install-uum</id>
<phase>validate</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>mvn</executable>
<arguments>
<argument>install:install-file</argument>
<argument>-Dfile=${basedir}/entity-service-1.0.0.jar</argument>
<argument>-DgroupId=com.xyz.app</argument>
<argument>-DartifactId=entity-service</argument>
<argument>-Dversion=1.0.0</argument>
<argument>-Dpackaging=jar</argument>
</arguments>
</execution>
Looks like the maven is not set in the path. Is there any way I can setup maven executable in the PATH from pom.xml instead of doing set PATH=%M2_HOME%\bin;%PATH%
from command line?