pom.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  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.5.0.0.0</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.5.0.0.0</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. <nodemodules.dir>node_modules</nodemodules.dir> <!-- specify -Dnodemodules.dir option to reduce ambari-web build time by not re-downloading npm modules -->
  34. </properties>
  35. <build>
  36. <plugins>
  37. <plugin>
  38. <groupId>org.codehaus.mojo</groupId>
  39. <artifactId>build-helper-maven-plugin</artifactId>
  40. <version>1.8</version>
  41. <executions>
  42. <execution>
  43. <id>parse-version</id>
  44. <phase>validate</phase>
  45. <goals>
  46. <goal>parse-version</goal>
  47. </goals>
  48. </execution>
  49. <execution>
  50. <id>regex-property</id>
  51. <goals>
  52. <goal>regex-property</goal>
  53. </goals>
  54. <configuration>
  55. <name>ambariVersion</name>
  56. <value>${project.version}</value>
  57. <regex>^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)(\.|-).*</regex>
  58. <replacement>$1.$2.$3.$4</replacement>
  59. <failIfNoMatch>false</failIfNoMatch>
  60. </configuration>
  61. </execution>
  62. </executions>
  63. </plugin>
  64. <plugin>
  65. <artifactId>maven-compiler-plugin</artifactId>
  66. <version>3.0</version>
  67. </plugin>
  68. <plugin>
  69. <groupId>org.codehaus.mojo</groupId>
  70. <artifactId>rpm-maven-plugin</artifactId>
  71. <version>2.0.1</version>
  72. <executions>
  73. <execution>
  74. <!-- unbinds rpm creation from maven lifecycle -->
  75. <phase>none</phase>
  76. <goals>
  77. <goal>attached-rpm</goal>
  78. </goals>
  79. </execution>
  80. </executions>
  81. <configuration>
  82. <copyright>2012, Apache Software Foundation</copyright>
  83. <group>Development</group>
  84. <description>Maven Recipe: RPM Package.</description>
  85. <mappings/>
  86. </configuration>
  87. </plugin>
  88. <plugin>
  89. <groupId>org.codehaus.mojo</groupId>
  90. <artifactId>exec-maven-plugin</artifactId>
  91. <version>1.2.1</version>
  92. <executions>
  93. <execution>
  94. <id>clean-rmdir</id>
  95. <phase>clean</phase>
  96. <goals>
  97. <goal>exec</goal>
  98. </goals>
  99. <configuration>
  100. <executable>${executable.rmdir}</executable>
  101. <workingDirectory>${basedir}</workingDirectory>
  102. <commandlineArgs>${args.rm.clean} public ${nodemodules.dir}</commandlineArgs>
  103. <successCodes>
  104. <successCode>0</successCode>
  105. <successCode>1</successCode>
  106. <successCode>2</successCode>
  107. </successCodes>
  108. </configuration>
  109. </execution>
  110. <execution>
  111. <id>clean-mkdir</id>
  112. <phase>clean</phase>
  113. <goals>
  114. <goal>exec</goal>
  115. </goals>
  116. <configuration>
  117. <executable>${executable.mkdir}</executable>
  118. <workingDirectory>${basedir}</workingDirectory>
  119. <commandlineArgs>${args.mkdir} public</commandlineArgs>
  120. </configuration>
  121. </execution>
  122. </executions>
  123. </plugin>
  124. <plugin>
  125. <groupId>com.github.eirslett</groupId>
  126. <artifactId>frontend-maven-plugin</artifactId>
  127. <version>0.0.16</version>
  128. <configuration>
  129. <nodeVersion>v4.5.0</nodeVersion>
  130. <npmVersion>2.15.0</npmVersion>
  131. <workingDirectory>${basedir}</workingDirectory>
  132. </configuration>
  133. <executions>
  134. <execution>
  135. <id>install node and npm</id>
  136. <phase>generate-sources</phase>
  137. <goals>
  138. <goal>install-node-and-npm</goal>
  139. </goals>
  140. </execution>
  141. <execution>
  142. <id>npm install</id>
  143. <phase>generate-sources</phase>
  144. <goals>
  145. <goal>npm</goal>
  146. </goals>
  147. <configuration>
  148. <arguments>install</arguments>
  149. </configuration>
  150. </execution>
  151. </executions>
  152. </plugin>
  153. <plugin>
  154. <groupId>org.codehaus.mojo</groupId>
  155. <artifactId>exec-maven-plugin</artifactId>
  156. <version>1.2.1</version>
  157. <executions>
  158. <execution>
  159. <id>Brunch build</id>
  160. <phase>generate-resources</phase>
  161. <goals>
  162. <goal>exec</goal>
  163. </goals>
  164. <configuration>
  165. <workingDirectory>${basedir}</workingDirectory>
  166. <executable>${basedir}/node/${node.executable}</executable>
  167. <arguments>
  168. <argument>node_modules/brunch/bin/brunch</argument>
  169. <argument>build</argument>
  170. </arguments>
  171. </configuration>
  172. </execution>
  173. <execution>
  174. <id>set-ambari-version</id>
  175. <phase>compile</phase>
  176. <goals>
  177. <goal>exec</goal>
  178. </goals>
  179. <configuration>
  180. <!-- sets Ambari version to make it accessible from code -->
  181. <executable>${executable.shell}</executable>
  182. <workingDirectory>${basedir}</workingDirectory>
  183. <commandlineArgs>${args.shell} ${basedir}${dirsep}set-ambari-version.${fileextension.shell} ${ambariVersion}</commandlineArgs>
  184. </configuration>
  185. </execution>
  186. <execution>
  187. <id>set-default-stack-version</id>
  188. <phase>compile</phase>
  189. <goals>
  190. <goal>exec</goal>
  191. </goals>
  192. <configuration>
  193. <!-- sets default stack and version to use for install -->
  194. <executable>${executable.shell}</executable>
  195. <workingDirectory>${basedir}</workingDirectory>
  196. <commandlineArgs>${args.shell} ${basedir}${dirsep}set-default-stack-version.${fileextension.shell} ${defaultStackVersion}</commandlineArgs>
  197. </configuration>
  198. </execution>
  199. <execution>
  200. <id>toggle-experimental</id>
  201. <phase>compile</phase>
  202. <goals>
  203. <goal>exec</goal>
  204. </goals>
  205. <configuration>
  206. <!-- enables experimental features if enableExperimental is set to true -->
  207. <executable>${executable.shell}</executable>
  208. <workingDirectory>${basedir}</workingDirectory>
  209. <commandlineArgs>${args.shell} ${basedir}${dirsep}toggle-experimental.${fileextension.shell} ${enableExperimental}</commandlineArgs>
  210. </configuration>
  211. </execution>
  212. <execution>
  213. <id>ambari-web unit tests</id>
  214. <phase>test</phase>
  215. <goals>
  216. <goal>exec</goal>
  217. </goals>
  218. <configuration>
  219. <skip>${skipTests}</skip>
  220. <executable>${executable.npm}</executable>
  221. <workingDirectory>${basedir}</workingDirectory>
  222. <commandlineArgs>${args.npm} test</commandlineArgs>
  223. </configuration>
  224. </execution>
  225. </executions>
  226. </plugin>
  227. <plugin>
  228. <groupId>org.apache.maven.plugins</groupId>
  229. <artifactId>maven-antrun-plugin</artifactId>
  230. <version>1.7</version>
  231. <executions>
  232. <execution>
  233. <id>gzip ambari-web images and fontawesome fonts</id>
  234. <phase>prepare-package</phase>
  235. <goals>
  236. <goal>run</goal>
  237. </goals>
  238. <configuration>
  239. <tasks>
  240. <apply executable="${executable.gzip}">
  241. <arg value="-f"/>
  242. <fileset dir="${basedir}/public/img/">
  243. <patternset>
  244. <include name="**/*.png"/>
  245. </patternset>
  246. </fileset>
  247. </apply>
  248. <apply executable="${executable.gzip}">
  249. <arg value="-f"/>
  250. <fileset dir="${basedir}/public/font/">
  251. <patternset>
  252. <include name="**/*"/>
  253. </patternset>
  254. </fileset>
  255. </apply>
  256. </tasks>
  257. </configuration>
  258. </execution>
  259. </executions>
  260. </plugin>
  261. <plugin>
  262. <groupId>org.apache.rat</groupId>
  263. <artifactId>apache-rat-plugin</artifactId>
  264. <configuration>
  265. <excludes>
  266. <exclude>.idea/**</exclude>
  267. <exclude>package.json</exclude>
  268. <exclude>public/**</exclude>
  269. <exclude>public-static/**</exclude>
  270. <exclude>app/assets/**</exclude>
  271. <exclude>vendor/**</exclude>
  272. <exclude>node_modules/**</exclude>
  273. <exclude>node/**</exclude>
  274. <exclude>npm-debug.log</exclude>
  275. </excludes>
  276. </configuration>
  277. <executions>
  278. <execution>
  279. <phase>test</phase>
  280. <goals>
  281. <goal>check</goal>
  282. </goals>
  283. </execution>
  284. </executions>
  285. </plugin>
  286. <plugin>
  287. <groupId>org.vafer</groupId>
  288. <artifactId>jdeb</artifactId>
  289. <version>1.0.1</version>
  290. <executions>
  291. <execution>
  292. <phase>none</phase>
  293. <goals>
  294. <goal>jdeb</goal>
  295. </goals>
  296. </execution>
  297. </executions>
  298. <configuration>
  299. <skip>true</skip>
  300. <submodules>false</submodules>
  301. </configuration>
  302. </plugin>
  303. </plugins>
  304. </build>
  305. <profiles>
  306. <profile>
  307. <id>windows</id>
  308. <activation>
  309. <os>
  310. <family>win</family>
  311. </os>
  312. </activation>
  313. <properties>
  314. <envClassifier>win</envClassifier>
  315. <dirsep>\</dirsep>
  316. <executable.brunch>cmd</executable.brunch>
  317. <executable.gzip>${basedir}\gzip-content.cmd</executable.gzip>
  318. <args.brunch>/C brunch</args.brunch>
  319. <node.executable>node.exe</node.executable>
  320. <executable.mkdir>cmd</executable.mkdir>
  321. <args.mkdir>/C mkdir</args.mkdir>
  322. <executable.npm>cmd</executable.npm>
  323. <args.npm>/C npm</args.npm>
  324. <executable.rmdir>cmd</executable.rmdir>
  325. <args.rm.clean>/C rmdir /S /Q</args.rm.clean>
  326. <executable.shell>cmd</executable.shell>
  327. <fileextension.shell>cmd</fileextension.shell>
  328. <args.shell>/C</args.shell>
  329. </properties>
  330. </profile>
  331. <profile>
  332. <id>linux</id>
  333. <activation>
  334. <os>
  335. <family>unix</family>
  336. </os>
  337. </activation>
  338. <properties>
  339. <envClassifier>linux</envClassifier>
  340. <dirsep>/</dirsep>
  341. <executable.brunch>brunch</executable.brunch>
  342. <executable.gzip>gzip</executable.gzip>
  343. <args.brunch></args.brunch>
  344. <node.executable>node</node.executable>
  345. <executable.mkdir>mkdir</executable.mkdir>
  346. <args.mkdir></args.mkdir>
  347. <executable.npm>npm</executable.npm>
  348. <args.npm></args.npm>
  349. <executable.rmdir>rm</executable.rmdir>
  350. <args.rm.clean>-rf</args.rm.clean>
  351. <executable.shell>sh</executable.shell>
  352. <fileextension.shell>sh</fileextension.shell>
  353. <args.shell></args.shell>
  354. </properties>
  355. </profile>
  356. <profile>
  357. <id>pluggable-stack-definition</id>
  358. <activation>
  359. <activeByDefault>false</activeByDefault>
  360. </activation>
  361. <build>
  362. <plugins>
  363. <plugin>
  364. <groupId>org.codehaus.mojo</groupId>
  365. <artifactId>exec-maven-plugin</artifactId>
  366. <version>1.2.1</version>
  367. <executions>
  368. <execution>
  369. <id>copy-pluggable-stack-resources</id>
  370. <phase>initialize</phase>
  371. <goals>
  372. <goal>exec</goal>
  373. </goals>
  374. <configuration>
  375. <!-- Copy stack specific UI resources -->
  376. <executable>${executable.shell}</executable>
  377. <workingDirectory>${basedir}</workingDirectory>
  378. <commandlineArgs>${args.shell} ${basedir}${dirsep}copy-pluggable-stack-resources.${fileextension.shell} ${stack.distribution}</commandlineArgs>
  379. </configuration>
  380. </execution>
  381. </executions>
  382. </plugin>
  383. </plugins>
  384. </build>
  385. </profile>
  386. </profiles>
  387. </project>