Skip to content

Commit

Permalink
Merge remote-tracking branch 'apache/master' into ZOOKEEPER-3567
Browse files Browse the repository at this point in the history
  • Loading branch information
symat authored and Mate Szalay-Beko committed Jan 16, 2020
2 parents d25d610 + 1c5d135 commit a5839cb
Show file tree
Hide file tree
Showing 158 changed files with 5,419 additions and 2,256 deletions.
19 changes: 16 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
language: java
sudo: false
jdk:
- openjdk8
- openjdk11

matrix:
include:
- os: linux
jdk: openjdk8
- os: linux
jdk: openjdk11
- os: linux
arch: s390x
jdk: openjdk11
addons:
apt:
update: true
packages:
- maven
- libcppunit-dev

cache:
directories:
Expand Down
2 changes: 1 addition & 1 deletion NOTICE.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Apache ZooKeeper
Copyright 2009-2014 The Apache Software Foundation
Copyright 2009-2019 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ is voted on and approved by the Apache ZooKeeper PMC:

https://repo1.maven.org/maven2/org/apache/zookeeper/zookeeper/

## Java 8

If you are going to compile with Java 1.8, you should use a
recent release at u211 or above.

# Contributing
We always welcome new contributors to the project! See [How to Contribute](https://cwiki.apache.org/confluence/display/ZOOKEEPER/HowToContribute) for details on how to submit patch through pull request and our contribution workflow.

Expand Down
11 changes: 9 additions & 2 deletions README_packaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@ Optional parameters you might consider when using maven:
- `-Pfull-build` - activates the full-build profile, causing the C client to be built
- `-DskipTests` - this parameter will skip both java and C++ unit test execution during the build
- `-Pc-test-coverage` - activates the test coverage calculation during the execution of C client tests

- `-Dc-client-openssl` - specify ssl support and openssl library location. Default value: `yes`, resulting in
the autodetection of the openssl library. If the openssl library will not be detected,
then a warning will be shown and the C client will be compiled without SSL support.
Use `-Dc-client-openssl=no` to explicitly disable SSL feature in C client. Or use
`-Dc-client-openssl=/path/to/openssl/` if you want to use a non-default / specific
openssl library location.

Please note: if you don't provide the `-Pfull-build` parameter, then the C client will not be built, the C client tests
will not be executed and the previous C client builds will no be cleaned up (e.g. with simply using `mvn clean`).

Expand All @@ -66,4 +72,5 @@ The compiled C client can be found here:
- `zookeeper-client/zookeeper-client-c/target/c/lib` - Native libraries
- `zookeeper-client/zookeeper-client-c/target/c/include/zookeeper` - Native library headers

The same folders gets archived to the `zookeeper-assembly/target/apache-zookeeper-<version>-lib.tar.gz` file, assuming you activated the `full-build` maven profile.
The same folders gets archived to the `zookeeper-assembly/target/apache-zookeeper-<version>-lib.tar.gz` file, assuming
you activated the `full-build` maven profile.
8 changes: 7 additions & 1 deletion bin/zkServer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,13 @@ then
echo "ZooKeeper remote JMX authenticate set to $JMXAUTH" >&2
echo "ZooKeeper remote JMX ssl set to $JMXSSL" >&2
echo "ZooKeeper remote JMX log4j set to $JMXLOG4J" >&2
ZOOMAIN="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=$JMXPORT -Dcom.sun.management.jmxremote.authenticate=$JMXAUTH -Dcom.sun.management.jmxremote.ssl=$JMXSSL -Dzookeeper.jmx.log4j.disable=$JMXLOG4J org.apache.zookeeper.server.quorum.QuorumPeerMain"
if [ "x$JMXHOSTNAME" = "x" ]
then
ZOOMAIN="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=$JMXPORT -Dcom.sun.management.jmxremote.authenticate=$JMXAUTH -Dcom.sun.management.jmxremote.ssl=$JMXSSL -Dzookeeper.jmx.log4j.disable=$JMXLOG4J org.apache.zookeeper.server.quorum.QuorumPeerMain"
else
echo "ZooKeeper remote JMX Hostname set to $JMXHOSTNAME" >&2
ZOOMAIN="-Dcom.sun.management.jmxremote -Djava.rmi.server.hostname=$JMXHOSTNAME -Dcom.sun.management.jmxremote.port=$JMXPORT -Dcom.sun.management.jmxremote.authenticate=$JMXAUTH -Dcom.sun.management.jmxremote.ssl=$JMXSSL -Dzookeeper.jmx.log4j.disable=$JMXLOG4J org.apache.zookeeper.server.quorum.QuorumPeerMain"
fi
fi
else
echo "JMX disabled by user request" >&2
Expand Down
4 changes: 2 additions & 2 deletions dev/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# under the License.
#

FROM maven:3.6.1-jdk-11
FROM maven:3.6.3-jdk-8

RUN apt-get update
RUN apt-get install -y g++ cmake autoconf libcppunit-dev libtool
RUN apt-get install -y g++ cmake autoconf libcppunit-dev libtool openssl libssl-dev
3 changes: 0 additions & 3 deletions excludeFindBugsFilter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@
<!-- this problem is to be addressed in ZOOKEEPER-3227 -->
<Bug pattern="DM_DEFAULT_ENCODING"/>

<!-- not really a problem -->
<Bug pattern="DM_EXIT"/>

</FindBugsFilter>

77 changes: 67 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
<parent>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
<version>18</version>
<version>21</version>
<relativePath />
<!-- no parent resolution -->
</parent>
<groupId>org.apache.zookeeper</groupId>
<artifactId>parent</artifactId>
<packaging>pom</packaging>
<!-- to change version: mvn -\-batch-mode release:update-versions -DdevelopmentVersion=3.6.0-SNAPSHOT -->
<version>3.6.0-SNAPSHOT</version>
<version>3.7.0-SNAPSHOT</version>
<name>Apache ZooKeeper</name>
<description>
ZooKeeper is a centralized service for maintaining configuration information, naming,
Expand Down Expand Up @@ -70,6 +70,7 @@
<connection>scm:git:https://gitbox.apache.org/repos/asf/zookeeper.git</connection>
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf/zookeeper.git</developerConnection>
<url>https://gitbox.apache.org/repos/asf/zookeeper.git</url>
<tag>HEAD</tag>
</scm>
<issueManagement>
<system>JIRA</system>
Expand Down Expand Up @@ -245,6 +246,12 @@
<email>fangmin@apache.org</email>
<timezone>-8</timezone>
</developer>
<developer>
<id>eolivelli</id>
<name>Enrico Olivelli</name>
<email>eolivelli@apache.org</email>
<timezone>+1</timezone>
</developer>
</developers>

<profiles>
Expand Down Expand Up @@ -273,13 +280,14 @@
<!-- dependency versions -->
<slf4j.version>1.7.25</slf4j.version>
<audience-annotations.version>0.5.0</audience-annotations.version>
<jmockit.version>1.48</jmockit.version>
<junit.version>4.12</junit.version>
<log4j.version>1.2.17</log4j.version>
<mockito.version>2.27.0</mockito.version>
<hamcrest.version>1.3</hamcrest.version>
<commons-cli.version>1.2</commons-cli.version>
<netty.version>4.1.42.Final</netty.version>
<jetty.version>9.4.18.v20190429</jetty.version>
<jetty.version>9.4.24.v20191120</jetty.version>
<jackson.version>2.9.10.1</jackson.version>
<json.version>1.1.1</json.version>
<jline.version>2.11</jline.version>
Expand All @@ -291,6 +299,10 @@
<dropwizard.version>3.2.5</dropwizard.version>
<spotbugsannotations.version>3.1.9</spotbugsannotations.version>
<checkstyle.version>8.17</checkstyle.version>

<!-- parameter to pass to C client build -->
<c-client-openssl>yes</c-client-openssl>

</properties>

<dependencyManagement>
Expand Down Expand Up @@ -388,6 +400,11 @@
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.jmockit</groupId>
<artifactId>jmockit</artifactId>
<version>${jmockit.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down Expand Up @@ -517,10 +534,11 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<releaseProfiles>apache-release</releaseProfiles>
<arguments>-Dmaven.test.skip.exec ${arguments}</arguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.11.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -676,8 +694,8 @@
<configuration>
<exportAntProperties>true</exportAntProperties>
<target>
<property environment="env"/>
<exec executable="hostname" outputproperty="host.name"/>
<property environment="env" />
<exec executable="hostname" outputproperty="host.name" />
</target>
</configuration>
</execution>
Expand Down Expand Up @@ -816,8 +834,47 @@
<consoleOutput>true</consoleOutput>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<inherited>false</inherited>
<configuration>
<!-- update the version inside the C sources -->
<preparationGoals>clean install -DskipTests antrun:run@replace-cclient-files-during-release scm:add@add-cclient-files-during-release scm:checkin@commit-cclient-files-during-release</preparationGoals>
<completionGoals>clean install -DskipTests antrun:run@replace-cclient-files-during-release scm:add@add-cclient-files-during-release scm:checkin@commit-cclient-files-during-release</completionGoals>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<inherited>false</inherited>
<executions>
<execution>
<id>add-cclient-files-during-release</id>
<phase>none</phase>
<goals>
<goal>add</goal>
</goals>
<configuration>
<pushChanges>false</pushChanges>
<includes>zookeeper-client/zookeeper-client-c/CMakeLists.txt,zookeeper-client/zookeeper-client-c/configure.ac,zookeeper-client/zookeeper-client-c/include/zookeeper_version.h</includes>
</configuration>
</execution>
<execution>
<id>commit-cclient-files-during-release</id>
<phase>none</phase>
<goals>
<!-- git commit -->
<goal>checkin</goal>
</goals>
<configuration>
<pushChanges>false</pushChanges>
<message>Prepared ${project.version}</message>
</configuration>
</execution>
</executions>
</plugin>
</plugins>

<resources>
<resource>
<directory>${project.basedir}src/main/java/resources</directory>
Expand Down
3 changes: 1 addition & 2 deletions zookeeper-assembly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
<parent>
<groupId>org.apache.zookeeper</groupId>
<artifactId>parent</artifactId>
<version>3.6.0-SNAPSHOT</version>
<version>3.7.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper-assembly</artifactId>
<packaging>pom</packaging>
<name>Apache ZooKeeper - Assembly</name>
Expand Down
5 changes: 3 additions & 2 deletions zookeeper-assembly/src/main/assembly/lib-package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@
</fileSet>
<fileSet>
<!-- ZooKeeper license -->
<directory>${project.basedir}/..</directory>
<directory>${project.basedir}/../zookeeper-client/zookeeper-client-c</directory>
<includes>
<include>LICENSE.txt</include>
<include>LICENSE</include>
</includes>
<outputDirectory>/</outputDirectory>
<fileMode>${rw.file.permission}</fileMode>
<directoryMode>${rwx.file.permission}</directoryMode>
</fileSet>
Expand Down
5 changes: 1 addition & 4 deletions zookeeper-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,15 @@
<parent>
<groupId>org.apache.zookeeper</groupId>
<artifactId>parent</artifactId>
<version>3.6.0-SNAPSHOT</version>
<version>3.7.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper-client</artifactId>
<packaging>pom</packaging>
<name>Apache ZooKeeper - Client</name>
<description>ZooKeeper client</description>



<profiles>
<profile>
<id>full-build</id>
Expand Down
23 changes: 13 additions & 10 deletions zookeeper-client/zookeeper-client-c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

cmake_minimum_required(VERSION 3.5)

project(zookeeper VERSION 3.6.0)
project(zookeeper VERSION 3.7.0)
set(email user@zookeeper.apache.org)
set(description "zookeeper C client")

Expand Down Expand Up @@ -182,17 +182,20 @@ target_link_libraries(zookeeper PUBLIC
$<$<PLATFORM_ID:Linux>:rt> # clock_gettime
$<$<PLATFORM_ID:Windows>:ws2_32>) # Winsock 2.0

option(WITH_OPENSSL "openssl directory" OFF)
if(WITH_OPENSSL)
target_compile_definitions(zookeeper PUBLIC HAVE_OPENSSL_H)
include_directories(${WITH_OPENSSL}/include)
link_directories(${WITH_OPENSSL}/lib)
if(WIN32)
target_link_libraries(zookeeper PUBLIC ssleay32 libeay32)
option(WITH_OPENSSL "turn ON/OFF SSL support, or define openssl library location (default: ON)" ON)
message("-- using WITH_OPENSSL=${WITH_OPENSSL}")
if(NOT WITH_OPENSSL STREQUAL "OFF")
if(NOT WITH_OPENSSL STREQUAL "ON")
set(OPENSSL_ROOT_DIR,${WITH_OPENSSL})
endif()
find_package(OpenSSL)
if(OPENSSL_FOUND)
target_compile_definitions(zookeeper PUBLIC HAVE_OPENSSL_H)
target_link_libraries(zookeeper PUBLIC OpenSSL::SSL OpenSSL::Crypto)
message("-- OpenSSL libraries found! will build with SSL support.")
else()
target_link_libraries(zookeeper PUBLIC ssl crypto)
message("-- WARNING: unable to find OpenSSL libraries! will build without SSL support.")
endif()

endif()

if(WANT_SYNCAPI AND NOT WIN32)
Expand Down
Loading

0 comments on commit a5839cb

Please sign in to comment.