mojohaus / exec-maven-plugin

Exec Maven Plugin
https://www.mojohaus.org/exec-maven-plugin/
Apache License 2.0
166 stars 97 forks source link

exec-maven-plugin plugin error #111

Open flamant opened 6 years ago

flamant commented 6 years ago

I use the exec-maven-plugin as follows

<plugin>
          <artifactId>exec-maven-plugin</artifactId>
          <groupId>org.codehaus.mojo</groupId>
          <version>1.6.0</version>
          <executions>
            <execution>
              <id>npm install</id>
              <goals>
                <goal>exec</goal>
              </goals>
              <phase>generate-sources</phase>
              <configuration>
                <executable>${npm.executable}</executable>
                <arguments>
                  <argument>install</argument>
                </arguments>
                <workingDirectory>${basedir}/target/angular5/tourism</workingDirectory>
                <target>
                  <echo message="Npm install" />
                </target>
              </configuration>
            </execution>
          </executions>
        </plugin>

I have the following error

java.io.IOException: Cannot run program "npm" (in directory "/Users/admin/Application-Marwen/workspace/Tourism/Tourism-Web/target/angular5/tourism"): error=2, No such file or directory

However the directory "/Users/admin/Application-Marwen/workspace/Tourism/Tourism-Web/target/angular5/tourism" exists and the command npm install works in this directory in the console. I have the Apache Maven 3.5.4 installed and use eclipse

flamant commented 6 years ago

I add the tree structure as information on a similar post at this adress: https://stackoverflow.com/questions/51384032/exec-maven-plugin-plugin-error/51786123#51786123