pom.xml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <?xml version="1.0" encoding="UTF-8"?>
  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. /**
  5. * Licensed to the Apache Software Foundation (ASF) under one
  6. * or more contributor license agreements. See the NOTICE file
  7. * distributed with this work for additional information
  8. * regarding copyright ownership. The ASF licenses this file
  9. * to you under the Apache License, Version 2.0 (the
  10. * "License"); you may not use this file except in compliance
  11. * with the License. You may obtain a copy of the License at
  12. *
  13. * http://www.apache.org/licenses/LICENSE-2.0
  14. *
  15. * Unless required by applicable law or agreed to in writing, software
  16. * distributed under the License is distributed on an "AS IS" BASIS,
  17. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18. * See the License for the specific language governing permissions and
  19. * limitations under the License.
  20. */
  21. -->
  22. <modelVersion>4.0.0</modelVersion>
  23. <parent>
  24. <groupId>org.apache.zookeeper</groupId>
  25. <artifactId>zookeeper-client</artifactId>
  26. <version>3.10.0-SNAPSHOT</version>
  27. </parent>
  28. <artifactId>zookeeper-client-c</artifactId>
  29. <packaging>pom</packaging>
  30. <name>Apache ZooKeeper - Client - C</name>
  31. <description>ZooKeeper c client</description>
  32. <properties>
  33. <c-test-coverage-arg> </c-test-coverage-arg>
  34. </properties>
  35. <build>
  36. <plugins>
  37. <plugin>
  38. <groupId>org.codehaus.mojo</groupId>
  39. <artifactId>exec-maven-plugin</artifactId>
  40. <executions>
  41. <execution>
  42. <id>autoreconf</id>
  43. <phase>process-sources</phase>
  44. <goals>
  45. <goal>exec</goal>
  46. </goals>
  47. <configuration>
  48. <workingDirectory>${project.basedir}</workingDirectory>
  49. <executable>autoreconf</executable>
  50. <environmentVariables>
  51. <ACLOCAL>aclocal -I /usr/share/aclocal</ACLOCAL>
  52. </environmentVariables>
  53. <arguments>
  54. <argument>-if</argument>
  55. </arguments>
  56. </configuration>
  57. </execution>
  58. <execution>
  59. <id>configure</id>
  60. <phase>process-sources</phase>
  61. <goals>
  62. <goal>exec</goal>
  63. </goals>
  64. <configuration>
  65. <workingDirectory>${project.build.directory}/c</workingDirectory>
  66. <executable>${project.basedir}/configure</executable>
  67. <environmentVariables>
  68. <base_dir>${project.basedir}/../..</base_dir>
  69. <CALLER>ANT</CALLER>
  70. </environmentVariables>
  71. <arguments>
  72. <argument>--with-openssl=${c-client-openssl}</argument>
  73. <argument>--with-sasl=${c-client-sasl}</argument>
  74. <argument>--prefix=${project.build.directory}/c</argument>
  75. <argument>${c-test-coverage-arg}</argument>
  76. </arguments>
  77. </configuration>
  78. </execution>
  79. </executions>
  80. </plugin>
  81. <plugin>
  82. <groupId>org.apache.maven.plugins</groupId>
  83. <artifactId>maven-antrun-plugin</artifactId>
  84. <executions>
  85. <execution>
  86. <id>generate-sources</id>
  87. <phase>generate-sources</phase>
  88. <configuration>
  89. <target>
  90. <mkdir dir="target/c" />
  91. </target>
  92. </configuration>
  93. <goals>
  94. <goal>run</goal>
  95. </goals>
  96. </execution>
  97. <execution>
  98. <id>build-c-client</id>
  99. <phase>compile</phase>
  100. <configuration>
  101. <target>
  102. <exec dir="${basedir}/target/c" executable="make" failonerror="true">
  103. <env key="LD_LIBRARY_PATH" value="${env.LD_LIBRARY_PATH};/usr/lib" />
  104. <env key="PATH" path="${env.PATH};${basedir};" />
  105. <env key="CALLER" value="ANT" />
  106. <env key="CLOVER_HOME" value="${basedir}/../../zookeeper-server/target" />
  107. <env key="base_dir" value="${basedir}/../.." />
  108. <arg line="clean install" />
  109. </exec>
  110. </target>
  111. </configuration>
  112. <goals>
  113. <goal>run</goal>
  114. </goals>
  115. </execution>
  116. <execution>
  117. <id>replace-cclient-files-during-release</id>
  118. <phase>none</phase>
  119. <goals>
  120. <goal>run</goal>
  121. </goals>
  122. <configuration>
  123. <target>
  124. <replaceregexp file="include/zookeeper_version.h" match="project.*" replace="project(zookeeper VERSION ${project.version})" byline="true" />
  125. <replace file="include/zookeeper_version.h" value="">
  126. <replaceToken>-SNAPSHOT</replaceToken>
  127. </replace>
  128. <replaceregexp file="CMakeLists.txt" match="project.*" replace="project(zookeeper VERSION ${project.version})" byline="true" />
  129. <replace file="CMakeLists.txt" value="">
  130. <replaceToken>-SNAPSHOT</replaceToken>
  131. </replace>
  132. <replaceregexp file="configure.ac" match="AC_INIT.*" replace="AC_INIT([zookeeper C client],${project.version},[user@zookeeper.apache.org],[zookeeper])" byline="true" />
  133. <replace file="configure.ac" value="">
  134. <replaceToken>-SNAPSHOT</replaceToken>
  135. </replace>
  136. </target>
  137. </configuration>
  138. </execution>
  139. </executions>
  140. </plugin>
  141. </plugins>
  142. </build>
  143. <profiles>
  144. <profile>
  145. <id>c-test-coverage</id>
  146. <properties>
  147. <c-test-coverage-arg>--enable-gcov</c-test-coverage-arg>
  148. </properties>
  149. </profile>
  150. <profile>
  151. <!-- can be skipped by deactivating the profile with -P!cppunit (may need to escape or quote exclamation on command-line) -->
  152. <id>cppunit</id>
  153. <activation>
  154. <property>
  155. <!-- can also be skipped by -DskipCppUnit or with -DskipTests (see below) -->
  156. <name>!skipCppUnit</name>
  157. </property>
  158. </activation>
  159. <build>
  160. <plugins>
  161. <plugin>
  162. <groupId>org.apache.maven.plugins</groupId>
  163. <artifactId>maven-antrun-plugin</artifactId>
  164. <executions>
  165. <execution>
  166. <id>test-cppunit</id>
  167. <phase>test</phase>
  168. <configuration>
  169. <!-- do not run cpp tests if tests are globally skipped -->
  170. <skip>${skipTests}</skip>
  171. <target>
  172. <exec dir="${basedir}/target/c" executable="make" failonerror="true">
  173. <env key="LD_LIBRARY_PATH" value="${env.LD_LIBRARY_PATH};/usr/lib" />
  174. <env key="PATH" path="${env.PATH};${basedir};" />
  175. <env key="CALLER" value="ANT" />
  176. <env key="CLOVER_HOME" value="${basedir}/../../zookeeper-server/target" />
  177. <env key="base_dir" value="${basedir}/../.." />
  178. <arg line="check" />
  179. </exec>
  180. </target>
  181. </configuration>
  182. <goals>
  183. <goal>run</goal>
  184. </goals>
  185. </execution>
  186. </executions>
  187. </plugin>
  188. </plugins>
  189. </build>
  190. </profile>
  191. </profiles>
  192. </project>