AMBARI-10303. Install node / brunch and other build dependencies at build time (alexantonenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7450f4e1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7450f4e1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7450f4e1 Branch: refs/heads/trunk Commit: 7450f4e17c5d29bd401a9fbd938380b8033e9e99 Parents: b54cfb8 Author: Alex Antonenko <[email protected]> Authored: Wed Apr 1 15:46:47 2015 +0300 Committer: Alex Antonenko <[email protected]> Committed: Wed Apr 1 16:23:32 2015 +0300 ---------------------------------------------------------------------- ambari-web/pom.xml | 78 ++++++++++++++++++++++++++++++++++++++----------- pom.xml | 6 ++-- 2 files changed, 65 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/7450f4e1/ambari-web/pom.xml ---------------------------------------------------------------------- diff --git a/ambari-web/pom.xml b/ambari-web/pom.xml index 04f9b5d..8169219 100644 --- a/ambari-web/pom.xml +++ b/ambari-web/pom.xml @@ -87,6 +87,27 @@ </configuration> </plugin> <plugin> + <groupId>com.github.eirslett</groupId> + <artifactId>frontend-maven-plugin</artifactId> + <version>0.0.19</version> + <configuration> + <nodeVersion>v0.10.31</nodeVersion> + <npmVersion>1.4.28</npmVersion> + </configuration> + <executions> + <execution> + <id>install node and npm</id> + <goals> + <goal>install-node-and-npm</goal> + </goals> + <configuration> + <nodeVersion>v0.10.31</nodeVersion> + <npmVersion>1.4.28</npmVersion> + </configuration> + </execution> + </executions> + </plugin> + <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.2.1</version> @@ -100,7 +121,7 @@ <configuration> <executable>${executable.rmdir}</executable> <workingDirectory>${basedir}</workingDirectory> - <commandlineArgs>${args.rm.clean} public node_modules</commandlineArgs> + <commandlineArgs>${args.rm.clean} public node_modules node</commandlineArgs> <successCodes> <successCode>0</successCode> <successCode>1</successCode> @@ -117,19 +138,43 @@ <configuration> <executable>${executable.mkdir}</executable> <workingDirectory>${basedir}</workingDirectory> - <commandlineArgs>${args.mkdir} public</commandlineArgs> + <commandlineArgs>${args.mkdir} public node</commandlineArgs> + </configuration> + </execution> + <execution> + <id>npm-cache-clean</id> + <phase>compile</phase> + <goals> + <goal>exec</goal> + </goals> + <configuration> + <executable>${executable.node}</executable> + <workingDirectory>${basedir}</workingDirectory> + <commandlineArgs>${args.npm.full.path} cache clean</commandlineArgs> + </configuration> + </execution> + <execution> + <id>install-npm</id> + <phase>compile</phase> + <goals> + <goal>exec</goal> + </goals> + <configuration> + <executable>${executable.node}</executable> + <workingDirectory>${basedir}</workingDirectory> + <commandlineArgs>${args.npm.full.path} install</commandlineArgs> </configuration> </execution> <execution> - <id>compile-npm</id> + <id>install-brunch</id> <phase>compile</phase> <goals> <goal>exec</goal> </goals> <configuration> - <executable>${executable.npm}</executable> + <executable>${executable.node}</executable> <workingDirectory>${basedir}</workingDirectory> - <commandlineArgs>${args.npm} install</commandlineArgs> + <commandlineArgs>${args.npm.full.path} install [email protected]</commandlineArgs> </configuration> </execution> <execution> @@ -139,9 +184,9 @@ <goal>exec</goal> </goals> <configuration> - <executable>${executable.brunch}</executable> + <executable>${executable.node}</executable> <workingDirectory>${basedir}</workingDirectory> - <commandlineArgs>${args.brunch} build</commandlineArgs> + <commandlineArgs>${args.brunch.full.path} build</commandlineArgs> </configuration> </execution> <execution> @@ -191,9 +236,9 @@ </goals> <configuration> <skip>${skipTests}</skip> - <executable>${executable.npm}</executable> + <executable>${executable.node}</executable> <workingDirectory>${basedir}</workingDirectory> - <commandlineArgs>${args.npm} test</commandlineArgs> + <commandlineArgs>${args.npm.full.path} test</commandlineArgs> </configuration> </execution> <execution> @@ -227,6 +272,7 @@ <exclude>app/assets/**</exclude> <exclude>vendor/**</exclude> <exclude>node_modules/**</exclude> + <exclude>node/**</exclude> <exclude>npm-debug.log</exclude> </excludes> </configuration> @@ -269,18 +315,17 @@ <properties> <envClassifier>win</envClassifier> <dirsep>\</dirsep> - <executable.brunch>cmd</executable.brunch> - <args.brunch>/C brunch</args.brunch> <executable.gzip>gzip</executable.gzip> <executable.mkdir>cmd</executable.mkdir> <args.mkdir>/C mkdir</args.mkdir> - <executable.npm>cmd</executable.npm> - <args.npm>/C npm</args.npm> <executable.rmdir>cmd</executable.rmdir> <args.rm.clean>/C rmdir /S /Q</args.rm.clean> <executable.shell>cmd</executable.shell> <fileextension.shell>cmd</fileextension.shell> <args.shell>/C</args.shell> + <executable.node>node.exe</executable.node> + <args.npm.full.path>node/npm/bin/npm-cli.js</args.npm.full.path> + <args.brunch.full.path>node_modules/brunch/bin/brunch</args.brunch.full.path> </properties> </profile> <profile> @@ -293,18 +338,17 @@ <properties> <envClassifier>linux</envClassifier> <dirsep>/</dirsep> - <executable.brunch>brunch</executable.brunch> - <args.brunch></args.brunch> <executable.gzip>gzip</executable.gzip> <executable.mkdir>mkdir</executable.mkdir> <args.mkdir></args.mkdir> - <executable.npm>npm</executable.npm> - <args.npm></args.npm> <executable.rmdir>rm</executable.rmdir> <args.rm.clean>-rf</args.rm.clean> <executable.shell>sh</executable.shell> <fileextension.shell>sh</fileextension.shell> <args.shell></args.shell> + <executable.node>node/node</executable.node> + <args.npm.full.path>node/npm/bin/npm-cli.js</args.npm.full.path> + <args.brunch.full.path>node_modules/brunch/bin/brunch</args.brunch.full.path> </properties> </profile> </profiles> http://git-wip-us.apache.org/repos/asf/ambari/blob/7450f4e1/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index c703bcf..96d7c47 100644 --- a/pom.xml +++ b/pom.xml @@ -283,14 +283,16 @@ <exclude>.hgignore</exclude> <exclude>.hgtags</exclude> + <!-- Nodejs and npm --> + <exclude>ambari-web/node_modules/**</exclude> + <exclude>ambari-web/node/**</exclude> + <!--Python Mock library (BSD license)--> <exclude>ambari-common/src/test/python/mock/**</exclude> <!--Jinja2 library (BSD license)--> <exclude>ambari-common/src/main/python/ambari_jinja2/**</exclude> <exclude>ambari-common/src/main/python/jinja2/**</exclude> - <exclude>ambari-web/node_modules/**</exclude> - <!--Contributions--> <exclude>contrib/ambari-scom/management-pack/Hadoop_MP/**</exclude> <exclude>contrib/addons/test/dataServices/jmx/data/cluster_configuration.json.nohbase</exclude>
