pom.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  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.2.1-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.2.1-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.conf.dir>/etc/ambari-agent/conf</package.conf.dir>
  36. <package.log.dir>/var/log/ambari-agent</package.log.dir>
  37. <package.pid.dir>/var/run/ambari-agent</package.pid.dir>
  38. <skipTests>false</skipTests>
  39. <facter.tar>http://downloads.puppetlabs.com/facter/facter-1.6.10.tar.gz</facter.tar>
  40. <puppet.tar>http://downloads.puppetlabs.com/puppet/puppet-2.7.9.tar.gz</puppet.tar>
  41. <install.dir>/usr/lib/python2.6/site-packages/ambari_agent</install.dir>
  42. <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>
  43. <lib.dir>/usr/lib/ambari-agent/lib</lib.dir>
  44. </properties>
  45. <profiles>
  46. <profile>
  47. <id>suse11</id>
  48. <properties>
  49. <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>
  50. </properties>
  51. </profile>
  52. <profile>
  53. <id>centos5</id>
  54. <properties>
  55. <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>
  56. </properties>
  57. </profile>
  58. </profiles>
  59. <build>
  60. <plugins>
  61. <plugin>
  62. <artifactId>maven-compiler-plugin</artifactId>
  63. <version>3.0</version>
  64. </plugin>
  65. <plugin>
  66. <artifactId>maven-assembly-plugin</artifactId>
  67. <configuration>
  68. <tarLongFileMode>gnu</tarLongFileMode>
  69. <descriptors>
  70. <descriptor>src/packages/tarball/all.xml</descriptor>
  71. </descriptors>
  72. </configuration>
  73. <executions>
  74. <execution>
  75. <id>build-tarball</id>
  76. <phase>prepare-package</phase>
  77. <goals>
  78. <goal>single</goal>
  79. </goals>
  80. </execution>
  81. </executions>
  82. </plugin>
  83. <plugin>
  84. <groupId>org.codehaus.mojo</groupId>
  85. <artifactId>exec-maven-plugin</artifactId>
  86. <version>1.2</version>
  87. <executions>
  88. <execution>
  89. <configuration>
  90. <executable>python2.6</executable>
  91. <workingDirectory>src/test/python</workingDirectory>
  92. <arguments>
  93. <argument>unitTests.py</argument>
  94. </arguments>
  95. <environmentVariables>
  96. <PYTHONPATH>${project.basedir}/../ambari-common/src/test/python:${project.basedir}/src/main/python/ambari_agent:$PYTHONPATH</PYTHONPATH>
  97. </environmentVariables>
  98. <skip>${skipTests}</skip>
  99. </configuration>
  100. <id>python-test</id>
  101. <phase>test</phase>
  102. <goals>
  103. <goal>exec</goal>
  104. </goals>
  105. </execution>
  106. <execution>
  107. <configuration>
  108. <executable>python2.6</executable>
  109. <workingDirectory>target/ambari-agent-${project.version}</workingDirectory>
  110. <arguments>
  111. <argument>${project.basedir}/src/main/python/setup.py</argument>
  112. <argument>clean</argument>
  113. <argument>bdist_dumb</argument>
  114. </arguments>
  115. <environmentVariables>
  116. <PYTHONPATH>target/ambari-agent-${project.version}:$PYTHONPATH</PYTHONPATH>
  117. </environmentVariables>
  118. </configuration>
  119. <id>python-package</id>
  120. <phase>package</phase>
  121. <goals>
  122. <goal>exec</goal>
  123. </goals>
  124. </execution>
  125. </executions>
  126. </plugin>
  127. <plugin>
  128. <groupId>org.codehaus.mojo</groupId>
  129. <artifactId>rpm-maven-plugin</artifactId>
  130. <version>2.0.1</version>
  131. <executions>
  132. <execution>
  133. <phase>none</phase>
  134. <goals>
  135. <goal>rpm</goal>
  136. </goals>
  137. </execution>
  138. </executions>
  139. <configuration>
  140. <copyright>2012, Apache Software Foundation</copyright>
  141. <group>Development</group>
  142. <description>Maven Recipe: RPM Package.</description>
  143. <requires>
  144. <require>openssl</require>
  145. <require>zlib</require>
  146. <require>${python.ver}</require>
  147. </requires>
  148. <postinstallScriptlet>
  149. <scriptFile>src/main/package/rpm/postinstall.sh</scriptFile>
  150. <fileEncoding>utf-8</fileEncoding>
  151. </postinstallScriptlet>
  152. <preinstallScriptlet>
  153. <scriptFile>src/main/package/rpm/preinstall.sh</scriptFile>
  154. <fileEncoding>utf-8</fileEncoding>
  155. </preinstallScriptlet>
  156. <preremoveScriptlet>
  157. <script>mv /etc/ambari-agent/conf /etc/ambari-agent/conf.save</script>
  158. </preremoveScriptlet>
  159. <needarch>x86_64</needarch>
  160. <autoRequires>false</autoRequires>
  161. <mappings>
  162. <mapping>
  163. <directory>${install.dir}</directory>
  164. <sources>
  165. <source>
  166. <location>${project.build.directory}/${project.artifactId}-${project.version}/ambari_agent</location>
  167. </source>
  168. </sources>
  169. </mapping>
  170. <mapping>
  171. <directory>${lib.dir}</directory>
  172. <sources>
  173. <source>
  174. <location>${project.build.directory}/lib</location>
  175. </source>
  176. </sources>
  177. </mapping>
  178. <mapping>
  179. <directory>${lib.dir}/examples</directory>
  180. <filemode>755</filemode>
  181. <username>root</username>
  182. <groupname>root</groupname>
  183. <sources>
  184. <source>
  185. <location>src/examples</location>
  186. </source>
  187. </sources>
  188. </mapping>
  189. <mapping>
  190. <directory>/var/lib/${project.artifactId}/puppet</directory>
  191. <filemode>755</filemode>
  192. <username>root</username>
  193. <groupname>root</groupname>
  194. <sources>
  195. <source>
  196. <location>src/main/puppet</location>
  197. </source>
  198. </sources>
  199. </mapping>
  200. <mapping>
  201. <directory>${package.conf.dir}</directory>
  202. <configuration>true</configuration>
  203. <filemode>755</filemode>
  204. <username>root</username>
  205. <groupname>root</groupname>
  206. <sources>
  207. <source>
  208. <location>conf/unix/ambari-agent.ini</location>
  209. </source>
  210. </sources>
  211. </mapping>
  212. <mapping>
  213. <directory>/usr/sbin</directory>
  214. <filemode>755</filemode>
  215. <username>root</username>
  216. <groupname>root</groupname>
  217. <sources>
  218. <source>
  219. <location>conf/unix/ambari-agent</location>
  220. </source>
  221. </sources>
  222. </mapping>
  223. <mapping>
  224. <directory>/var/lib/ambari-agent</directory>
  225. <filemode>700</filemode>
  226. <username>root</username>
  227. <groupname>root</groupname>
  228. <sources>
  229. <source>
  230. <location>conf/unix/ambari-env.sh</location>
  231. </source>
  232. </sources>
  233. </mapping>
  234. <mapping>
  235. <directory>${package.pid.dir}</directory>
  236. <filemode>755</filemode>
  237. <username>root</username>
  238. <groupname>root</groupname>
  239. </mapping>
  240. <mapping>
  241. <directory>/var/lib/${project.artifactId}/data</directory>
  242. <filemode>755</filemode>
  243. <username>root</username>
  244. <groupname>root</groupname>
  245. </mapping>
  246. <mapping>
  247. <directory>/var/lib/${project.artifactId}/keys</directory>
  248. <filemode>755</filemode>
  249. <username>root</username>
  250. <groupname>root</groupname>
  251. </mapping>
  252. <mapping>
  253. <directory>${package.log.dir}</directory>
  254. <filemode>755</filemode>
  255. <username>root</username>
  256. <groupname>root</groupname>
  257. </mapping>
  258. <mapping>
  259. <directory>/var/ambari-agent</directory>
  260. <filemode>755</filemode>
  261. <username>root</username>
  262. <groupname>root</groupname>
  263. </mapping>
  264. <!-- -->
  265. </mappings>
  266. </configuration>
  267. </plugin>
  268. <plugin>
  269. <groupId>com.github.goldin</groupId>
  270. <artifactId>copy-maven-plugin</artifactId>
  271. <version>0.2.5</version>
  272. <executions>
  273. <execution>
  274. <id>create-archive</id>
  275. <phase>package</phase>
  276. <goals>
  277. <goal>copy</goal>
  278. </goals>
  279. <configuration>
  280. <resources>
  281. <resource>
  282. <targetPath>${project.build.directory}/lib</targetPath>
  283. <file>${ruby.tar}</file>
  284. <unpack>true</unpack>
  285. </resource>
  286. <resource>
  287. <targetPath>${project.build.directory}/lib</targetPath>
  288. <file>${facter.tar}</file>
  289. <unpack>true</unpack>
  290. </resource>
  291. <resource>
  292. <targetPath>${project.build.directory}/lib</targetPath>
  293. <file>${puppet.tar}</file>
  294. <unpack>true</unpack>
  295. </resource>
  296. </resources>
  297. </configuration>
  298. </execution>
  299. </executions>
  300. </plugin>
  301. <plugin>
  302. <groupId>org.apache.rat</groupId>
  303. <artifactId>apache-rat-plugin</artifactId>
  304. <configuration>
  305. <excludes>
  306. <exclude>src/examples/*</exclude>
  307. <exclude>src/test/python/dummy*.txt</exclude>
  308. <exclude>src/main/puppet/modules/stdlib/**</exclude>
  309. <exclude>**/*.erb</exclude>
  310. <exclude>**/*.json</exclude>
  311. </excludes>
  312. </configuration>
  313. </plugin>
  314. </plugins>
  315. <extensions>
  316. <extension>
  317. <groupId>org.apache.maven.wagon</groupId>
  318. <artifactId>wagon-ssh-external</artifactId>
  319. </extension>
  320. </extensions>
  321. </build>
  322. </project>