My Spring-boot project structure is below
-Project
- src
- main
- java
- resources
- webapp
- test
- frontend
- src
- static
- config
- package.json
- (after "npm install") node_modules
- (after "npm run build") dist
what I want to do is
when a project is installed, run "npm install"
when "spring-boot:run" runs, run "npm run build" and moves contents in front/dist to /main/webapp
here is my pom.xml
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>exec-npm-install</id>
<phase>generate-sources</phase>
<configuration>
<executable>npm</executable>
<workingDirectory>./frontend</workingDirectory>
<arguments>
<argument>install</argument>
</arguments>
</configuration>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
I don't know how can I trigger exec-npm-install exection with Eclipse maven build, I tried generate-sources, spring-boot:run, install and compile, package but it didn't run.
and I want to know what command should I put, to move dist when "spring-boot:run"