Last active
August 29, 2015 14:28
-
-
Save jesty/78aefd91e7116d4fafb1 to your computer and use it in GitHub Desktop.
Execute NPM during a Maven build.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- In my JEE project I use REACT with Babel and Webpack and I must build the javascript files before prepare the WAR. | |
I have also configure webpack.config.js to build in a folder under my web application, e.g.: | |
var DIST_PATH = path.resolve(ROOT_PATH, '../src/main/java/webapp/js/react'); | |
To setup REACT inside my project I used https://github.com/gesposito/bare-webpack | |
--> | |
<project> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.codehaus.mojo</groupId> | |
<artifactId>exec-maven-plugin</artifactId> | |
<executions> | |
<execution> | |
<id>some-execution</id> | |
<phase>prepare-package</phase> | |
<goals> | |
<goal>exec</goal> | |
</goals> | |
</execution> | |
</executions> | |
<configuration> | |
<executable>npm</executable> | |
<arguments> | |
<argument>run</argument> | |
<argument>build</argument> | |
</arguments> | |
<workingDirectory>react</workingDirectory> | |
</configuration> | |
</plugin> | |
</plugins> | |
</build> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment