pom.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <?xml version="1.0"?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  17. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  18. <parent>
  19. <groupId>org.apache.ambari</groupId>
  20. <artifactId>ambari-project</artifactId>
  21. <version>2.0.0-SNAPSHOT</version>
  22. <relativePath>../ambari-project</relativePath>
  23. </parent>
  24. <modelVersion>4.0.0</modelVersion>
  25. <artifactId>ambari-web</artifactId>
  26. <packaging>pom</packaging>
  27. <name>Ambari Web</name>
  28. <version>2.0.0-SNAPSHOT</version>
  29. <description>Ambari Web</description>
  30. <properties>
  31. <ambari.dir>${project.parent.parent.basedir}</ambari.dir>
  32. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  33. </properties>
  34. <build>
  35. <plugins>
  36. <plugin>
  37. <groupId>org.codehaus.mojo</groupId>
  38. <artifactId>build-helper-maven-plugin</artifactId>
  39. <version>1.8</version>
  40. <executions>
  41. <execution>
  42. <id>parse-version</id>
  43. <phase>validate</phase>
  44. <goals>
  45. <goal>parse-version</goal>
  46. </goals>
  47. </execution>
  48. <execution>
  49. <id>regex-property</id>
  50. <goals>
  51. <goal>regex-property</goal>
  52. </goals>
  53. <configuration>
  54. <name>ambariVersion</name>
  55. <value>${project.version}</value>
  56. <regex>^([0-9]+)\.([0-9]+)\.([0-9]+)(\.|-).*</regex>
  57. <replacement>$1.$2.$3</replacement>
  58. <failIfNoMatch>false</failIfNoMatch>
  59. </configuration>
  60. </execution>
  61. </executions>
  62. </plugin>
  63. <plugin>
  64. <artifactId>maven-compiler-plugin</artifactId>
  65. <version>3.0</version>
  66. </plugin>
  67. <plugin>
  68. <groupId>org.codehaus.mojo</groupId>
  69. <artifactId>rpm-maven-plugin</artifactId>
  70. <version>2.0.1</version>
  71. <executions>
  72. <execution>
  73. <!-- unbinds rpm creation from maven lifecycle -->
  74. <phase>none</phase>
  75. <goals>
  76. <goal>attached-rpm</goal>
  77. </goals>
  78. </execution>
  79. </executions>
  80. <configuration>
  81. <copyright>2012, Apache Software Foundation</copyright>
  82. <group>Development</group>
  83. <description>Maven Recipe: RPM Package.</description>
  84. <mappings/>
  85. </configuration>
  86. </plugin>
  87. <plugin>
  88. <groupId>com.github.eirslett</groupId>
  89. <artifactId>frontend-maven-plugin</artifactId>
  90. <version>0.0.14</version>
  91. <configuration>
  92. <nodeVersion>v0.10.26</nodeVersion>
  93. <npmVersion>1.4.3</npmVersion>
  94. <workingDirectory>${basedir}</workingDirectory>
  95. </configuration>
  96. <executions>
  97. <execution>
  98. <id>install node and npm</id>
  99. <phase>generate-sources</phase>
  100. <goals>
  101. <goal>install-node-and-npm</goal>
  102. </goals>
  103. </execution>
  104. <execution>
  105. <id>npm install</id>
  106. <phase>generate-sources</phase>
  107. <goals>
  108. <goal>npm</goal>
  109. </goals>
  110. <configuration>
  111. <arguments>install --unsafe-perm</arguments>
  112. </configuration>
  113. </execution>
  114. </executions>
  115. </plugin>
  116. <plugin>
  117. <groupId>org.codehaus.mojo</groupId>
  118. <artifactId>exec-maven-plugin</artifactId>
  119. <version>1.2.1</version>
  120. <executions>
  121. <execution>
  122. <id>clean-rmdir</id>
  123. <phase>clean</phase>
  124. <goals>
  125. <goal>exec</goal>
  126. </goals>
  127. <configuration>
  128. <executable>${executable.rmdir}</executable>
  129. <workingDirectory>${basedir}</workingDirectory>
  130. <commandlineArgs>${args.rm.clean} public node_modules</commandlineArgs>
  131. <successCodes>
  132. <successCode>0</successCode>
  133. <successCode>1</successCode>
  134. <successCode>2</successCode>
  135. </successCodes>
  136. </configuration>
  137. </execution>
  138. <execution>
  139. <id>clean-mkdir</id>
  140. <phase>clean</phase>
  141. <goals>
  142. <goal>exec</goal>
  143. </goals>
  144. <configuration>
  145. <executable>${executable.mkdir}</executable>
  146. <workingDirectory>${basedir}</workingDirectory>
  147. <commandlineArgs>${args.mkdir} public</commandlineArgs>
  148. </configuration>
  149. </execution>
  150. <execution>
  151. <id>install-brunch</id>
  152. <phase>compile</phase>
  153. <goals>
  154. <goal>exec</goal>
  155. </goals>
  156. <configuration>
  157. <executable>${executable.node}</executable>
  158. <workingDirectory>${basedir}</workingDirectory>
  159. <commandlineArgs>${args.npm.full.path} install brunch@v1.7.20</commandlineArgs>
  160. </configuration>
  161. </execution>
  162. <execution>
  163. <id>compile-brunch</id>
  164. <phase>compile</phase>
  165. <goals>
  166. <goal>exec</goal>
  167. </goals>
  168. <configuration>
  169. <executable>${executable.node}</executable>
  170. <workingDirectory>${basedir}</workingDirectory>
  171. <commandlineArgs>${args.brunch.full.path} build</commandlineArgs>
  172. </configuration>
  173. </execution>
  174. <execution>
  175. <id>set-ambari-version</id>
  176. <phase>compile</phase>
  177. <goals>
  178. <goal>exec</goal>
  179. </goals>
  180. <configuration>
  181. <!-- sets Ambari version to make it accessible from code -->
  182. <executable>${executable.shell}</executable>
  183. <workingDirectory>${basedir}</workingDirectory>
  184. <commandlineArgs>${args.shell} ${basedir}${dirsep}set-ambari-version.${fileextension.shell} ${ambariVersion}</commandlineArgs>
  185. </configuration>
  186. </execution>
  187. <execution>
  188. <id>set-default-stack-version</id>
  189. <phase>compile</phase>
  190. <goals>
  191. <goal>exec</goal>
  192. </goals>
  193. <configuration>
  194. <!-- sets default stack and version to use for install -->
  195. <executable>${executable.shell}</executable>
  196. <workingDirectory>${basedir}</workingDirectory>
  197. <commandlineArgs>${args.shell} ${basedir}${dirsep}set-default-stack-version.${fileextension.shell} ${defaultStackVersion}</commandlineArgs>
  198. </configuration>
  199. </execution>
  200. <execution>
  201. <id>toggle-experimental</id>
  202. <phase>compile</phase>
  203. <goals>
  204. <goal>exec</goal>
  205. </goals>
  206. <configuration>
  207. <!-- enables experimental features if enableExperimental is set to true -->
  208. <executable>${executable.shell}</executable>
  209. <workingDirectory>${basedir}</workingDirectory>
  210. <commandlineArgs>${args.shell} ${basedir}${dirsep}toggle-experimental.${fileextension.shell} ${enableExperimental}</commandlineArgs>
  211. </configuration>
  212. </execution>
  213. <execution>
  214. <id>ambari-web unit tests</id>
  215. <phase>test</phase>
  216. <goals>
  217. <goal>exec</goal>
  218. </goals>
  219. <configuration>
  220. <skip>${skipTests}</skip>
  221. <executable>${executable.node}</executable>
  222. <workingDirectory>${basedir}</workingDirectory>
  223. <commandlineArgs>${args.npm.full.path} test</commandlineArgs>
  224. </configuration>
  225. </execution>
  226. <execution>
  227. <id>gzip ambari-web content</id>
  228. <phase>prepare-package</phase>
  229. <goals>
  230. <goal>exec</goal>
  231. </goals>
  232. <configuration>
  233. <executable>${executable.gzip}</executable>
  234. <workingDirectory>${basedir}</workingDirectory>
  235. <arguments>
  236. <argument>-f</argument>
  237. <argument>public/javascripts/app.js</argument>
  238. <argument>public/javascripts/vendor.js</argument>
  239. <argument>public/stylesheets/app.css</argument>
  240. </arguments>
  241. </configuration>
  242. </execution>
  243. </executions>
  244. </plugin>
  245. <plugin>
  246. <groupId>org.apache.rat</groupId>
  247. <artifactId>apache-rat-plugin</artifactId>
  248. <configuration>
  249. <excludes>
  250. <exclude>.idea/**</exclude>
  251. <exclude>package.json</exclude>
  252. <exclude>public/**</exclude>
  253. <exclude>public-static/**</exclude>
  254. <exclude>app/assets/**</exclude>
  255. <exclude>vendor/**</exclude>
  256. <exclude>node_modules/**</exclude>
  257. <exclude>node/**</exclude>
  258. <exclude>npm-debug.log</exclude>
  259. </excludes>
  260. </configuration>
  261. <executions>
  262. <execution>
  263. <phase>test</phase>
  264. <goals>
  265. <goal>check</goal>
  266. </goals>
  267. </execution>
  268. </executions>
  269. </plugin>
  270. <plugin>
  271. <groupId>org.vafer</groupId>
  272. <artifactId>jdeb</artifactId>
  273. <version>1.0.1</version>
  274. <executions>
  275. <execution>
  276. <phase>none</phase>
  277. <goals>
  278. <goal>jdeb</goal>
  279. </goals>
  280. </execution>
  281. </executions>
  282. <configuration>
  283. <skip>true</skip>
  284. <submodules>false</submodules>
  285. </configuration>
  286. </plugin>
  287. </plugins>
  288. </build>
  289. <profiles>
  290. <profile>
  291. <id>windows</id>
  292. <activation>
  293. <os>
  294. <family>win</family>
  295. </os>
  296. </activation>
  297. <properties>
  298. <envClassifier>win</envClassifier>
  299. <dirsep>\</dirsep>
  300. <executable.gzip>gzip</executable.gzip>
  301. <executable.mkdir>cmd</executable.mkdir>
  302. <args.mkdir>/C mkdir</args.mkdir>
  303. <executable.rmdir>cmd</executable.rmdir>
  304. <args.rm.clean>/C rmdir /S /Q</args.rm.clean>
  305. <executable.shell>cmd</executable.shell>
  306. <fileextension.shell>cmd</fileextension.shell>
  307. <args.shell>/C</args.shell>
  308. <executable.node>node.exe</executable.node>
  309. <args.npm.full.path>node/npm/bin/npm-cli.js</args.npm.full.path>
  310. <args.brunch.full.path>node_modules/brunch/bin/brunch</args.brunch.full.path>
  311. </properties>
  312. </profile>
  313. <profile>
  314. <id>linux</id>
  315. <activation>
  316. <os>
  317. <family>unix</family>
  318. </os>
  319. </activation>
  320. <properties>
  321. <envClassifier>linux</envClassifier>
  322. <dirsep>/</dirsep>
  323. <executable.gzip>gzip</executable.gzip>
  324. <executable.mkdir>mkdir</executable.mkdir>
  325. <args.mkdir></args.mkdir>
  326. <executable.rmdir>rm</executable.rmdir>
  327. <args.rm.clean>-rf</args.rm.clean>
  328. <executable.shell>sh</executable.shell>
  329. <fileextension.shell>sh</fileextension.shell>
  330. <args.shell></args.shell>
  331. <executable.node>node/node</executable.node>
  332. <args.npm.full.path>node/npm/bin/npm-cli.js</args.npm.full.path>
  333. <args.brunch.full.path>node_modules/brunch/bin/brunch</args.brunch.full.path>
  334. </properties>
  335. </profile>
  336. </profiles>
  337. </project>