@ramaem12 - I had a similar issue recently. We were working on generating dispatcher files via NodeJS scripts using com.github.eirslett.
We added the below execution goals in the plugin to do the following -
- Install Node.Js and npm
- Trigger npm install to generate resources
- Trigger npm run to run-script build
Please check the pom.xml as below -
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.11.3</version>
<configuration>
<installDirectory>${project.basedir}/.generator</installDirectory>
</configuration>
<executions>
<execution>
<id>Install Node.js and npm</id>
<phase>generate-resources</phase>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<workingDirectory>${project.basedir}/.generator</workingDirectory>
</configuration>
</execution>
<execution>
<id>npm install</id>
<phase>generate-resources</phase>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<workingDirectory>${project.basedir}/.generator</workingDirectory>
</configuration>
</execution>
<execution>
<id>npm run</id>
<phase>generate-resources</phase>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<workingDirectory>${project.basedir}/.generator</workingDirectory>
<arguments>run-script build</arguments>
</configuration>
</execution>
</executions>
</plugin>