Skip to content

Commit

Permalink
Fixes for Java 11 (#3006)
Browse files Browse the repository at this point in the history
* [java-11] Compilation fixes

* Runtime fixes

* Fix dependencies for discovery service

* Fixed json mapper provider in new jersey

* Fixed license files

* Added hk2 dep to proxy

* Added hk2 deps to pulsar-client-admin as well

* added missing jar in license file

* More license fixes
  • Loading branch information
merlimat committed Nov 25, 2018
1 parent 9d2c001 commit 716a6b4
Show file tree
Hide file tree
Showing 28 changed files with 282 additions and 219 deletions.
19 changes: 0 additions & 19 deletions distribution/server/licenses/LICENSE-Lombok.txt

This file was deleted.

6 changes: 6 additions & 0 deletions distribution/server/pom.xml
Expand Up @@ -56,6 +56,12 @@
<groupId>org.apache.pulsar</groupId>
<artifactId>pulsar-client-tools</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>io.grpc</groupId>
<artifactId>grpc-testing</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down
70 changes: 38 additions & 32 deletions distribution/server/src/assemble/LICENSE.bin.txt
Expand Up @@ -417,25 +417,25 @@ The Apache Software License, Version 2.0
* HttpClient
- org.apache.httpcomponents-httpclient-4.5.5.jar
- org.apache.httpcomponents-httpcore-4.4.9.jar
* Google Error Prone Annotations - com.google.errorprone-error_prone_annotations-2.1.2.jar
* Google Error Prone Annotations - com.google.errorprone-error_prone_annotations-2.2.0.jar
* OkHttp - com.squareup.okhttp-okhttp-2.5.0.jar
* Okio - com.squareup.okio-okio-1.13.0.jar
* Javassist -- org.javassist-javassist-3.21.0-GA.jar
* gRPC
- io.grpc-grpc-all-1.12.0.jar
- io.grpc-grpc-auth-1.12.0.jar
- io.grpc-grpc-context-1.12.0.jar
- io.grpc-grpc-core-1.12.0.jar
- io.grpc-grpc-netty-1.12.0.jar
- io.grpc-grpc-okhttp-1.12.0.jar
- io.grpc-grpc-protobuf-1.12.0.jar
- io.grpc-grpc-protobuf-lite-1.12.0.jar
- io.grpc-grpc-protobuf-nano-1.12.0.jar
- io.grpc-grpc-stub-1.12.0.jar
- io.grpc-grpc-all-1.16.1.jar
- io.grpc-grpc-auth-1.16.1.jar
- io.grpc-grpc-context-1.16.1.jar
- io.grpc-grpc-core-1.16.1.jar
- io.grpc-grpc-netty-1.16.1.jar
- io.grpc-grpc-okhttp-1.16.1.jar
- io.grpc-grpc-protobuf-1.16.1.jar
- io.grpc-grpc-protobuf-lite-1.16.1.jar
- io.grpc-grpc-protobuf-nano-1.16.1.jar
- io.grpc-grpc-stub-1.16.1.jar
- io.grpc-grpc-testing-1.12.0.jar
* OpenCensus
- io.opencensus-opencensus-api-0.11.0.jar
- io.opencensus-opencensus-contrib-grpc-metrics-0.11.0.jar
- io.opencensus-opencensus-api-0.12.3.jar
- io.opencensus-opencensus-contrib-grpc-metrics-0.12.3.jar
* Paranamer
- com.thoughtworks.paranamer-paranamer-2.7.jar
* Jodah
Expand Down Expand Up @@ -469,14 +469,16 @@ The Apache Software License, Version 2.0
- io.dropwizard.metrics-metrics-jvm-3.1.0.jar
* Prometheus
- io.prometheus-simpleclient_httpserver-0.5.0.jar
* JavaX Injection
- javax.inject-javax.inject-1.jar


BSD 3-clause "New" or "Revised" License
* Google auth library
- com.google.auth-google-auth-library-credentials-0.9.0.jar -- licenses/LICENSE-google-auth-library.txt
* JLine -- jline-jline-0.9.94.jar -- licenses/LICENSE.JLine.txt
* LevelDB -- (included in org.rocksdb.*.jar) -- licenses/LICENSE-LevelDB.txt
* JSR305 -- com.google.code.findbugs-jsr305-3.0.0.jar -- licenses/LICENSE-JSR305.txt
* JSR305 -- com.google.code.findbugs-jsr305-3.0.2.jar -- licenses/LICENSE-JSR305.txt

BSD 2-Clause License
* HdrHistogram -- org.hdrhistogram-HdrHistogram-2.1.9.jar -- licenses/LICENSE-HdrHistogram.txt
Expand All @@ -487,7 +489,8 @@ MIT License
- org.slf4j-jul-to-slf4j-1.7.25.jar
- org.slf4j-slf4j-api-1.7.25.jar
- org.slf4j-jcl-over-slf4j-1.7.25.jar
* Lombok -- org.projectlombok-lombok-1.18.0.jar -- licenses/LICENSE-Lombok.txt
* Animal Sniffer Annotations
- org.codehaus.mojo-animal-sniffer-annotations-1.17.jar

Protocol Buffers License
* Protocol Buffers
Expand All @@ -498,33 +501,36 @@ Protocol Buffers License
CDDL-1.1 -- licenses/LICENSE-CDDL-1.1.txt
* Java Annotations API
- javax.annotation-javax.annotation-api-1.2.jar
- javax.activation-javax.activation-api-1.2.0.jar
- javax.xml.bind-activation-1.0.2.jar
- javax.xml.bind-jaxb-api-2.3.1.jar
* Java Servlet API -- javax.servlet-javax.servlet-api-3.1.0.jar
* WebSocket Server API -- javax.websocket-javax.websocket-client-api-1.0.jar
* Java Web Service REST API -- javax.ws.rs-javax.ws.rs-api-2.1.jar
* HK2 - Dependency Injection Kernel
- org.glassfish.hk2-hk2-api-2.5.0-b30.jar
- org.glassfish.hk2-hk2-locator-2.5.0-b30.jar
- org.glassfish.hk2-hk2-utils-2.5.0-b30.jar
- org.glassfish.hk2-hk2-api-2.5.0-b42.jar
- org.glassfish.hk2-hk2-locator-2.5.0-b42.jar
- org.glassfish.hk2-hk2-utils-2.5.0-b42.jar
- org.glassfish.hk2-osgi-resource-locator-1.0.1.jar
- org.glassfish.hk2.external-aopalliance-repackaged-2.5.0-b30.jar
- org.glassfish.hk2.external-javax.inject-2.5.0-b30.jar
- org.glassfish.hk2.external-aopalliance-repackaged-2.5.0-b42.jar
- org.glassfish.hk2.external-javax.inject-2.5.0-b42.jar
* Jersey
- org.glassfish.jersey.bundles.repackaged-jersey-guava-2.25.jar
- org.glassfish.jersey.containers-jersey-container-servlet-2.25.jar
- org.glassfish.jersey.containers-jersey-container-servlet-core-2.25.jar
- org.glassfish.jersey.core-jersey-client-2.25.jar
- org.glassfish.jersey.core-jersey-common-2.25.jar
- org.glassfish.jersey.core-jersey-server-2.25.jar
- org.glassfish.jersey.ext-jersey-entity-filtering-2.25.jar
- org.glassfish.jersey.media-jersey-media-jaxb-2.25.jar
- org.glassfish.jersey.media-jersey-media-json-jackson-2.25.jar
- org.glassfish.jersey.media-jersey-media-multipart-2.25.jar
- org.glassfish.jersey.containers-jersey-container-servlet-2.27.jar
- org.glassfish.jersey.containers-jersey-container-servlet-core-2.27.jar
- org.glassfish.jersey.core-jersey-client-2.27.jar
- org.glassfish.jersey.core-jersey-common-2.27.jar
- org.glassfish.jersey.core-jersey-server-2.27.jar
- org.glassfish.jersey.ext-jersey-entity-filtering-2.27.jar
- org.glassfish.jersey.media-jersey-media-jaxb-2.27.jar
- org.glassfish.jersey.media-jersey-media-json-jackson-2.27.jar
- org.glassfish.jersey.media-jersey-media-multipart-2.27.jar
- org.glassfish.jersey.inject-jersey-hk2-2.27.jar
* Mimepull -- org.jvnet.mimepull-mimepull-1.9.6.jar

Eclipse Public License 1.0 -- licenses/LICENSE-AspectJ.txt
* AspectJ
- org.aspectj-aspectjrt-1.9.1.jar
- org.aspectj-aspectjweaver-1.9.1.jar
- org.aspectj-aspectjrt-1.9.2.jar
- org.aspectj-aspectjweaver-1.9.2.jar

Public Domain
* XZ for Java -- licenses/LICENSE-xz.txt
Expand Down
2 changes: 2 additions & 0 deletions distribution/server/src/assemble/bin.xml
Expand Up @@ -137,6 +137,8 @@
<!-- Explicitely remove JUnit which is getting pulled in even
though it's set to the scope 'test' -->
<exclude>junit:junit</exclude>

<exclude>org.projectlombok:lombok</exclude>
</excludes>
</dependencySet>
</dependencySets>
Expand Down
60 changes: 54 additions & 6 deletions pom.xml
Expand Up @@ -146,10 +146,10 @@ flexible messaging model and an intuitive client API.</description>
<netty.version>4.1.22.Final</netty.version>
<storm.version>1.0.5</storm.version>
<jetty.version>9.4.12.v20180830</jetty.version>
<jersey.version>2.25</jersey.version>
<jersey.version>2.27</jersey.version>
<athenz.version>1.7.17</athenz.version>
<prometheus.version>0.5.0</prometheus.version>
<aspectj.version>1.9.1</aspectj.version>
<aspectj.version>1.9.2</aspectj.version>
<rocksdb.version>5.13.3</rocksdb.version>
<slf4j.version>1.7.25</slf4j.version>
<commons.collections.version>3.2.2</commons.collections.version>
Expand All @@ -163,7 +163,7 @@ flexible messaging model and an intuitive client API.</description>
<protobuf2.version>2.4.1</protobuf2.version>
<protobuf3.version>3.5.1</protobuf3.version>
<protoc3.version>3.5.1-1</protoc3.version>
<grpc.version>1.12.0</grpc.version>
<grpc.version>1.16.1</grpc.version>
<protoc-gen-grpc-java.version>1.0.0</protoc-gen-grpc-java.version>
<gson.version>2.8.2</gson.version>
<sketches.version>0.8.3</sketches.version>
Expand All @@ -181,6 +181,7 @@ flexible messaging model and an intuitive client API.</description>
<flink.version>1.6.0</flink.version>
<scala.binary.version>2.11</scala.binary.version>
<debezium.version>0.8.2</debezium.version>
<opencensus.version>0.12.3</opencensus.version>

<!-- test dependencies -->
<arquillian-cube.version>1.15.1</arquillian-cube.version>
Expand All @@ -190,8 +191,9 @@ flexible messaging model and an intuitive client API.</description>
<testcontainers.version>1.8.0</testcontainers.version>

<!-- Plugin dependencies -->
<protobuf-maven-plugin.version>0.5.0</protobuf-maven-plugin.version>
<protobuf-maven-plugin.version>0.6.1</protobuf-maven-plugin.version>
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
<aspectj-maven-plugin.version>1.11.1</aspectj-maven-plugin.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -520,6 +522,12 @@ flexible messaging model and an intuitive client API.</description>
<artifactId>jersey-client</artifactId>
<version>${jersey.version}</version>
</dependency>

<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>${jersey.version}</version>
</dependency>

<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
Expand Down Expand Up @@ -575,6 +583,12 @@ flexible messaging model and an intuitive client API.</description>
<version>${jackson.version}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-jaxb-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
Expand Down Expand Up @@ -863,6 +877,41 @@ flexible messaging model and an intuitive client API.</description>
<artifactId>assertj-core</artifactId>
<version>3.11.1</version>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.4</version>
</dependency>

<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.2</version>
</dependency>

<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>

<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>activation</artifactId>
<version>1.0.2</version>
</dependency>

<dependency>
<groupId>io.opencensus</groupId>
<artifactId>opencensus-api</artifactId>
<version>${opencensus.version}</version>
</dependency>
<dependency>
<groupId>io.opencensus</groupId>
<artifactId>opencensus-contrib-grpc-metrics</artifactId>
<version>${opencensus.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down Expand Up @@ -908,7 +957,6 @@ flexible messaging model and an intuitive client API.</description>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.0</version>
<scope>provided</scope>
</dependency>

Expand Down Expand Up @@ -1224,7 +1272,7 @@ flexible messaging model and an intuitive client API.</description>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<version>3.8.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
@@ -0,0 +1,36 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.pulsar.broker.web;

import com.fasterxml.jackson.databind.ObjectMapper;

import javax.ws.rs.ext.ContextResolver;
import javax.ws.rs.ext.Provider;

import org.apache.pulsar.common.util.ObjectMapperFactory;

@Provider
public class JsonMapperProvider implements ContextResolver<ObjectMapper> {
private final ObjectMapper mapper = ObjectMapperFactory.create();

@Override
public ObjectMapper getContext(Class<?> type) {
return mapper;
}
}
18 changes: 16 additions & 2 deletions pulsar-broker/pom.xml
Expand Up @@ -174,6 +174,11 @@
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
</dependency>

<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
Expand Down Expand Up @@ -277,14 +282,23 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>

<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>activation</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<groupId>com.github.m50d</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.10</version>
<version>${aspectj-maven-plugin.version}</version>
<configuration>
<complianceLevel>1.8</complianceLevel>
<source>1.8</source>
Expand Down

0 comments on commit 716a6b4

Please sign in to comment.