pom.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. <?xml version="1.0"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  3. <!--
  4. Licensed to the Apache Software Foundation (ASF) under one or more
  5. contributor license agreements. See the NOTICE file distributed with
  6. this work for additional information regarding copyright ownership.
  7. The ASF licenses this file to You under the Apache License, Version 2.0
  8. (the "License"); you may not use this file except in compliance with
  9. the License. You may obtain a copy of the License at
  10. http://www.apache.org/licenses/LICENSE-2.0
  11. Unless required by applicable law or agreed to in writing, software
  12. distributed under the License is distributed on an "AS IS" BASIS,
  13. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. See the License for the specific language governing permissions and
  15. limitations under the License.
  16. -->
  17. <parent>
  18. <groupId>org.apache.ambari</groupId>
  19. <artifactId>ambari-project</artifactId>
  20. <version>1.3.0-SNAPSHOT</version>
  21. <relativePath>../ambari-project</relativePath>
  22. </parent>
  23. <modelVersion>4.0.0</modelVersion>
  24. <groupId>org.apache.ambari</groupId>
  25. <artifactId>ambari-agent</artifactId>
  26. <packaging>pom</packaging>
  27. <version>1.3.0-SNAPSHOT</version>
  28. <name>Ambari Agent</name>
  29. <description>Ambari Agent</description>
  30. <properties>
  31. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  32. <final.name>${project.artifactId}-${project.version}</final.name>
  33. <package.release>1</package.release>
  34. <package.prefix>/usr</package.prefix>
  35. <package.log.dir>/var/log/ambari-agent</package.log.dir>
  36. <package.pid.dir>/var/run/ambari-agent</package.pid.dir>
  37. <skipTests>false</skipTests>
  38. <facter.tar>http://downloads.puppetlabs.com/facter/facter-1.6.10.tar.gz</facter.tar>
  39. <puppet.tar>http://downloads.puppetlabs.com/puppet/puppet-2.7.9.tar.gz</puppet.tar>
  40. <agent.install.dir>/usr/lib/python2.6/site-packages/ambari_agent</agent.install.dir>
  41. <resmgmt.install.dir>/usr/lib/python2.6/site-packages/resource_management</resmgmt.install.dir>
  42. <jinja.install.dir>/usr/lib64/python2.6/site-packages/jinja2</jinja.install.dir>
  43. <ruby.tar>http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.15/repos/centos6/ruby-1.8.7-p370.tar.gz</ruby.tar>
  44. <lib.dir>/usr/lib/ambari-agent/lib</lib.dir>
  45. <python.ver>python &gt;= 2.6</python.ver>
  46. </properties>
  47. <profiles>
  48. <profile>
  49. <id>suse11</id>
  50. <properties>
  51. <ruby.tar>http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.15/repos/suse11/ruby-1.8.7-p370.tar.gz</ruby.tar>
  52. </properties>
  53. </profile>
  54. <profile>
  55. <id>centos5</id>
  56. <properties>
  57. <ruby.tar>http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.15/repos/centos5/ruby-1.8.7-p370.tar.gz</ruby.tar>
  58. </properties>
  59. </profile>
  60. </profiles>
  61. <build>
  62. <plugins>
  63. <plugin>
  64. <groupId>org.codehaus.mojo</groupId>
  65. <artifactId>build-helper-maven-plugin</artifactId>
  66. <version>1.8</version>
  67. <executions>
  68. <execution>
  69. <id>parse-version</id>
  70. <phase>validate</phase>
  71. <goals>
  72. <goal>parse-version</goal>
  73. </goals>
  74. </execution>
  75. <execution>
  76. <id>regex-property</id>
  77. <goals>
  78. <goal>regex-property</goal>
  79. </goals>
  80. <configuration>
  81. <name>ambariVersion</name>
  82. <value>${project.version}</value>
  83. <regex>-SNAPSHOT</regex>
  84. <replacement></replacement>
  85. <failIfNoMatch>false</failIfNoMatch>
  86. </configuration>
  87. </execution>
  88. </executions>
  89. </plugin>
  90. <plugin>
  91. <artifactId>maven-compiler-plugin</artifactId>
  92. <version>3.0</version>
  93. </plugin>
  94. <plugin>
  95. <artifactId>maven-assembly-plugin</artifactId>
  96. <configuration>
  97. <tarLongFileMode>gnu</tarLongFileMode>
  98. <descriptors>
  99. <descriptor>src/packages/tarball/all.xml</descriptor>
  100. </descriptors>
  101. </configuration>
  102. <executions>
  103. <execution>
  104. <id>build-tarball</id>
  105. <phase>prepare-package</phase>
  106. <goals>
  107. <goal>single</goal>
  108. </goals>
  109. </execution>
  110. </executions>
  111. </plugin>
  112. <plugin>
  113. <groupId>org.codehaus.mojo</groupId>
  114. <artifactId>exec-maven-plugin</artifactId>
  115. <version>1.2</version>
  116. <executions>
  117. <execution>
  118. <configuration>
  119. <executable>python2.6</executable>
  120. <workingDirectory>src/test/python</workingDirectory>
  121. <arguments>
  122. <argument>unitTests.py</argument>
  123. </arguments>
  124. <environmentVariables>
  125. <PYTHONPATH>${project.basedir}/../ambari-common/src/main/python/jinja2:${project.basedir}/../ambari-common/src/test/python:${project.basedir}/../ambari-common/src/main/python:${project.basedir}/src/main/python/ambari_agent:${project.basedir}/src/main/python/resource_management:${project.basedir}/src/test/python/ambari_agent:${project.basedir}/src/test/python/resource_management:${project.basedir}/src/main/python:${project.basedir}/../ambari-agent/src/main/puppet/modules/hdp-hadoop/files:$PYTHONPATH</PYTHONPATH>
  126. </environmentVariables>
  127. <skip>${skipTests}</skip>
  128. </configuration>
  129. <id>python-test</id>
  130. <phase>test</phase>
  131. <goals>
  132. <goal>exec</goal>
  133. </goals>
  134. </execution>
  135. <execution>
  136. <configuration>
  137. <executable>python2.6</executable>
  138. <workingDirectory>target/ambari-agent-${project.version}</workingDirectory>
  139. <arguments>
  140. <argument>${project.basedir}/src/main/python/setup.py</argument>
  141. <argument>clean</argument>
  142. <argument>bdist_dumb</argument>
  143. </arguments>
  144. <environmentVariables>
  145. <PYTHONPATH>target/ambari-agent-${project.version}:$PYTHONPATH</PYTHONPATH>
  146. </environmentVariables>
  147. </configuration>
  148. <id>python-package</id>
  149. <phase>package</phase>
  150. <goals>
  151. <goal>exec</goal>
  152. </goals>
  153. </execution>
  154. </executions>
  155. </plugin>
  156. <plugin>
  157. <groupId>org.codehaus.mojo</groupId>
  158. <artifactId>rpm-maven-plugin</artifactId>
  159. <version>2.0.1</version>
  160. <executions>
  161. <execution>
  162. <!-- unbinds rpm creation from maven lifecycle -->
  163. <phase>none</phase>
  164. <goals>
  165. <goal>rpm</goal>
  166. </goals>
  167. </execution>
  168. </executions>
  169. <configuration>
  170. <copyright>2012, Apache Software Foundation</copyright>
  171. <group>Development</group>
  172. <description>Maven Recipe: RPM Package.</description>
  173. <requires>
  174. <require>openssl</require>
  175. <require>zlib</require>
  176. <require>${python.ver}</require>
  177. </requires>
  178. <postinstallScriptlet>
  179. <scriptFile>src/main/package/rpm/postinstall.sh</scriptFile>
  180. <fileEncoding>utf-8</fileEncoding>
  181. </postinstallScriptlet>
  182. <preinstallScriptlet>
  183. <scriptFile>src/main/package/rpm/preinstall.sh</scriptFile>
  184. <fileEncoding>utf-8</fileEncoding>
  185. </preinstallScriptlet>
  186. <preremoveScriptlet>
  187. <scriptFile>src/main/package/rpm/preremove.sh</scriptFile>
  188. <fileEncoding>utf-8</fileEncoding>
  189. </preremoveScriptlet>
  190. <needarch>x86_64</needarch>
  191. <autoRequires>false</autoRequires>
  192. <mappings>
  193. <mapping>
  194. <directory>${agent.install.dir}</directory>
  195. <sources>
  196. <source>
  197. <location>${project.build.directory}/${project.artifactId}-${project.version}/ambari_agent</location>
  198. </source>
  199. </sources>
  200. </mapping>
  201. <mapping>
  202. <directory>${resmgmt.install.dir}</directory>
  203. <sources>
  204. <source>
  205. <location>${project.build.directory}/${project.artifactId}-${project.version}/resource_management</location>
  206. </source>
  207. </sources>
  208. </mapping>
  209. <mapping>
  210. <directory>${lib.dir}</directory>
  211. <filemode>755</filemode>
  212. <username>root</username>
  213. <groupname>root</groupname>
  214. <sources>
  215. <source>
  216. <location>${project.build.directory}/lib</location>
  217. </source>
  218. </sources>
  219. </mapping>
  220. <mapping>
  221. <directory>${jinja.install.dir}</directory>
  222. <sources>
  223. <source>
  224. <location>${project.basedir}/../ambari-common/src/main/python/jinja2/jinja2</location>
  225. <excludes>
  226. <exclude>${project.basedir}/../ambari-common/src/main/python/jinja2/jinja2/testsuite</exclude>
  227. </excludes>
  228. </source>
  229. </sources>
  230. </mapping>
  231. <mapping>
  232. <directory>${lib.dir}/examples</directory>
  233. <filemode>755</filemode>
  234. <username>root</username>
  235. <groupname>root</groupname>
  236. <sources>
  237. <source>
  238. <location>src/examples</location>
  239. </source>
  240. </sources>
  241. </mapping>
  242. <mapping>
  243. <directory>/var/lib/${project.artifactId}/puppet</directory>
  244. <filemode>755</filemode>
  245. <username>root</username>
  246. <groupname>root</groupname>
  247. <sources>
  248. <source>
  249. <location>src/main/puppet</location>
  250. </source>
  251. </sources>
  252. </mapping>
  253. <mapping>
  254. <directory>/etc/ambari-agent/conf</directory>
  255. <filemode>755</filemode>
  256. <username>root</username>
  257. <groupname>root</groupname>
  258. <sources>
  259. <source>
  260. <location>conf/unix/ambari-agent.ini</location>
  261. </source>
  262. </sources>
  263. </mapping>
  264. <mapping>
  265. <directory>/usr/sbin</directory>
  266. <filemode>755</filemode>
  267. <username>root</username>
  268. <groupname>root</groupname>
  269. <sources>
  270. <source>
  271. <location>conf/unix/ambari-agent</location>
  272. <filter>true</filter>
  273. </source>
  274. </sources>
  275. </mapping>
  276. <mapping>
  277. <directory>/var/lib/ambari-agent</directory>
  278. <filemode>700</filemode>
  279. <username>root</username>
  280. <groupname>root</groupname>
  281. <sources>
  282. <source>
  283. <location>conf/unix/ambari-env.sh</location>
  284. </source>
  285. </sources>
  286. </mapping>
  287. <mapping>
  288. <directory>${package.pid.dir}</directory>
  289. <filemode>755</filemode>
  290. <username>root</username>
  291. <groupname>root</groupname>
  292. </mapping>
  293. <mapping>
  294. <directory>/var/lib/${project.artifactId}/data</directory>
  295. <filemode>755</filemode>
  296. <username>root</username>
  297. <groupname>root</groupname>
  298. </mapping>
  299. <mapping>
  300. <directory>/var/lib/${project.artifactId}/keys</directory>
  301. <filemode>755</filemode>
  302. <username>root</username>
  303. <groupname>root</groupname>
  304. </mapping>
  305. <mapping>
  306. <directory>${package.log.dir}</directory>
  307. <filemode>755</filemode>
  308. <username>root</username>
  309. <groupname>root</groupname>
  310. </mapping>
  311. <mapping>
  312. <directory>/etc/rc.d/init.d</directory>
  313. <filemode>755</filemode>
  314. <username>root</username>
  315. <groupname>root</groupname>
  316. <sources>
  317. <source>
  318. <location>etc/init.d/ambari-agent</location>
  319. </source>
  320. </sources>
  321. </mapping>
  322. <mapping>
  323. <directory>/var/lib/${project.artifactId}/data</directory>
  324. <filemode>755</filemode>
  325. <username>root</username>
  326. <groupname>root</groupname>
  327. <sources>
  328. <source>
  329. <location>../version</location>
  330. <filter>true</filter>
  331. </source>
  332. </sources>
  333. </mapping>
  334. <mapping>
  335. <!-- TODO: Remove when we introduce metadata downloading by agent-->
  336. <directory>/var/lib/ambari-agent/cache/stacks</directory>
  337. <sources>
  338. <source>
  339. <location>../ambari-server/src/main/resources/stacks</location>
  340. </source>
  341. </sources>
  342. </mapping>
  343. <mapping>
  344. <!-- custom actions root-->
  345. <directory>/var/lib/ambari-agent/resources</directory>
  346. <filemode>755</filemode>
  347. <username>root</username>
  348. <groupname>root</groupname>
  349. <sources>
  350. <source>
  351. <location>../ambari-server/src/main/resources/custom_actions</location>
  352. </source>
  353. </sources>
  354. </mapping>
  355. </mappings>
  356. </configuration>
  357. </plugin>
  358. <plugin>
  359. <groupId>com.github.goldin</groupId>
  360. <artifactId>copy-maven-plugin</artifactId>
  361. <version>0.2.5</version>
  362. <executions>
  363. <execution>
  364. <id>create-archive</id>
  365. <phase>package</phase>
  366. <goals>
  367. <goal>copy</goal>
  368. </goals>
  369. <configuration>
  370. <resources>
  371. <resource>
  372. <targetPath>${project.build.directory}/lib</targetPath>
  373. <file>${ruby.tar}</file>
  374. <unpack>true</unpack>
  375. </resource>
  376. <resource>
  377. <targetPath>${project.build.directory}/lib</targetPath>
  378. <file>${facter.tar}</file>
  379. <unpack>true</unpack>
  380. </resource>
  381. <resource>
  382. <targetPath>${project.build.directory}/lib</targetPath>
  383. <file>${puppet.tar}</file>
  384. <unpack>true</unpack>
  385. </resource>
  386. </resources>
  387. </configuration>
  388. </execution>
  389. </executions>
  390. </plugin>
  391. <plugin>
  392. <groupId>org.apache.rat</groupId>
  393. <artifactId>apache-rat-plugin</artifactId>
  394. <configuration>
  395. <excludes>
  396. <exclude>src/examples/*</exclude>
  397. <exclude>src/test/python/dummy*.txt</exclude>
  398. <exclude>src/main/python/ambari_agent/imports.txt</exclude>
  399. <exclude>src/main/puppet/modules/stdlib/**</exclude>
  400. <exclude>**/*.erb</exclude>
  401. <exclude>**/*.json</exclude>
  402. </excludes>
  403. </configuration>
  404. </plugin>
  405. <plugin>
  406. <groupId>org.codehaus.mojo</groupId>
  407. <artifactId>buildnumber-maven-plugin</artifactId>
  408. <version>${buildnumber-maven-plugin-version}</version>
  409. <configuration>
  410. <urlScm>scm:git:https://git-wip-us.apache.org/repos/asf/incubator-ambari.git</urlScm>
  411. </configuration>
  412. <executions>
  413. <execution>
  414. <phase>validate</phase>
  415. <goals>
  416. <goal>create</goal>
  417. </goals>
  418. </execution>
  419. </executions>
  420. </plugin>
  421. </plugins>
  422. <extensions>
  423. <extension>
  424. <groupId>org.apache.maven.wagon</groupId>
  425. <artifactId>wagon-ssh-external</artifactId>
  426. </extension>
  427. </extensions>
  428. </build>
  429. </project>