pom.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  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.2-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.2-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. <filemode>755</filemode>
  173. <username>root</username>
  174. <groupname>root</groupname>
  175. <sources>
  176. <source>
  177. <location>${project.build.directory}/lib</location>
  178. </source>
  179. </sources>
  180. </mapping>
  181. <mapping>
  182. <directory>${lib.dir}/examples</directory>
  183. <filemode>755</filemode>
  184. <username>root</username>
  185. <groupname>root</groupname>
  186. <sources>
  187. <source>
  188. <location>src/examples</location>
  189. </source>
  190. </sources>
  191. </mapping>
  192. <mapping>
  193. <directory>/var/lib/${project.artifactId}/puppet</directory>
  194. <filemode>755</filemode>
  195. <username>root</username>
  196. <groupname>root</groupname>
  197. <sources>
  198. <source>
  199. <location>src/main/puppet</location>
  200. </source>
  201. </sources>
  202. </mapping>
  203. <mapping>
  204. <directory>/var/lib/${project.artifactId}/upgrade_scripts</directory>
  205. <filemode>755</filemode>
  206. <username>root</username>
  207. <groupname>root</groupname>
  208. <sources>
  209. <source>
  210. <location>src/main/upgrade_scripts</location>
  211. </source>
  212. </sources>
  213. </mapping>
  214. <mapping>
  215. <directory>${package.conf.dir}</directory>
  216. <configuration>true</configuration>
  217. <filemode>755</filemode>
  218. <username>root</username>
  219. <groupname>root</groupname>
  220. <sources>
  221. <source>
  222. <location>conf/unix/ambari-agent.ini</location>
  223. </source>
  224. </sources>
  225. </mapping>
  226. <mapping>
  227. <directory>/usr/sbin</directory>
  228. <filemode>755</filemode>
  229. <username>root</username>
  230. <groupname>root</groupname>
  231. <sources>
  232. <source>
  233. <location>conf/unix/ambari-agent</location>
  234. </source>
  235. </sources>
  236. </mapping>
  237. <mapping>
  238. <directory>/var/lib/ambari-agent</directory>
  239. <filemode>700</filemode>
  240. <username>root</username>
  241. <groupname>root</groupname>
  242. <sources>
  243. <source>
  244. <location>conf/unix/ambari-env.sh</location>
  245. </source>
  246. </sources>
  247. </mapping>
  248. <mapping>
  249. <directory>${package.pid.dir}</directory>
  250. <filemode>755</filemode>
  251. <username>root</username>
  252. <groupname>root</groupname>
  253. </mapping>
  254. <mapping>
  255. <directory>/var/lib/${project.artifactId}/data</directory>
  256. <filemode>755</filemode>
  257. <username>root</username>
  258. <groupname>root</groupname>
  259. </mapping>
  260. <mapping>
  261. <directory>/var/lib/${project.artifactId}/keys</directory>
  262. <filemode>755</filemode>
  263. <username>root</username>
  264. <groupname>root</groupname>
  265. </mapping>
  266. <mapping>
  267. <directory>${package.log.dir}</directory>
  268. <filemode>755</filemode>
  269. <username>root</username>
  270. <groupname>root</groupname>
  271. </mapping>
  272. <mapping>
  273. <directory>/var/ambari-agent</directory>
  274. <filemode>755</filemode>
  275. <username>root</username>
  276. <groupname>root</groupname>
  277. </mapping>
  278. <!-- -->
  279. </mappings>
  280. </configuration>
  281. </plugin>
  282. <plugin>
  283. <groupId>com.github.goldin</groupId>
  284. <artifactId>copy-maven-plugin</artifactId>
  285. <version>0.2.5</version>
  286. <executions>
  287. <execution>
  288. <id>create-archive</id>
  289. <phase>package</phase>
  290. <goals>
  291. <goal>copy</goal>
  292. </goals>
  293. <configuration>
  294. <resources>
  295. <resource>
  296. <targetPath>${project.build.directory}/lib</targetPath>
  297. <file>${ruby.tar}</file>
  298. <unpack>true</unpack>
  299. </resource>
  300. <resource>
  301. <targetPath>${project.build.directory}/lib</targetPath>
  302. <file>${facter.tar}</file>
  303. <unpack>true</unpack>
  304. </resource>
  305. <resource>
  306. <targetPath>${project.build.directory}/lib</targetPath>
  307. <file>${puppet.tar}</file>
  308. <unpack>true</unpack>
  309. </resource>
  310. </resources>
  311. </configuration>
  312. </execution>
  313. </executions>
  314. </plugin>
  315. <plugin>
  316. <groupId>org.apache.rat</groupId>
  317. <artifactId>apache-rat-plugin</artifactId>
  318. <configuration>
  319. <excludes>
  320. <exclude>src/examples/*</exclude>
  321. <exclude>src/test/python/dummy*.txt</exclude>
  322. <exclude>src/main/python/ambari_agent/imports.txt</exclude>
  323. <exclude>src/main/puppet/modules/stdlib/**</exclude>
  324. <exclude>**/*.erb</exclude>
  325. <exclude>**/*.json</exclude>
  326. </excludes>
  327. </configuration>
  328. </plugin>
  329. </plugins>
  330. <extensions>
  331. <extension>
  332. <groupId>org.apache.maven.wagon</groupId>
  333. <artifactId>wagon-ssh-external</artifactId>
  334. </extension>
  335. </extensions>
  336. </build>
  337. </project>