Skip to content

Commit

Permalink
Allow building Apache Pulsar on JDK15+ - upgrade Maven Assembly Plugin (
Browse files Browse the repository at this point in the history
apache#8360)

Motivation
Currently Pulsar does not build on JDK15

Modifications
update Maven Assembly plugin
move maven-git-commit-id plugin execution only inside Pulsar Common (in order to speed up the build)
upgrading the Maven Assembly Plugin resulted in a different output for the "binaries", I had to update license files
forced version of Jersey to 2.31 in "Presto" distribution (otherwise the license check failed, because it does not handle different versions between main pulsar binaries and presto distribution inside lib/presto/lib, and this makes sense to me)
Verifying this change
This change is already covered by existing tests


* Allow to build Pulsar on JDK14+
- update Apache Maven Assembly Plugin
- use explicit import for Record class (prevent clash with java.lang.Record)

* revert Apache pom update

* fix

* Fix presto distribution - due to maven assembly plugin upgrade

* fix licenses

* Fix kafka clients

* fix LICENSE

Co-authored-by: Enrico Olivelli <[email protected]>
Co-authored-by: Enrico Olivelli <[email protected]>
  • Loading branch information
3 people authored Oct 29, 2020
1 parent c5705f2 commit b527ccc
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 47 deletions.
1 change: 0 additions & 1 deletion distribution/server/src/assemble/LICENSE.bin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ The Apache Software License, Version 2.0
- io.netty-netty-transport-native-epoll-4.1.51.Final.jar
- io.netty-netty-transport-native-unix-common-4.1.51.Final.jar
- io.netty-netty-transport-native-unix-common-4.1.51.Final-linux-x86_64.jar
- io.netty-netty-transport-native-kqueue-4.1.51.Final-osx-x86_64.jar
- io.netty-netty-tcnative-boringssl-static-2.0.30.Final.jar
* Prometheus client
- io.prometheus-simpleclient-0.5.0.jar
Expand Down
35 changes: 9 additions & 26 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -203,16 +203,17 @@ flexible messaging model and an intuitive client API.</description>
<license-maven-plugin.version>3.0</license-maven-plugin.version>
<maven-enforcer-plugin.version>3.0.0-M2</maven-enforcer-plugin.version>
<maven-surefire-plugin.version>3.0.0-M3</maven-surefire-plugin.version>
<maven-assembly-plugin.version>3.3.0</maven-assembly-plugin.version>
<maven-dependency-plugin.version>2.10</maven-dependency-plugin.version>
<maven-clean-plugin.version>2.4.1</maven-clean-plugin.version>
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<maven-shade-plugin>3.2.4</maven-shade-plugin>
<maven-javadoc-plugin.version>2.10.3</maven-javadoc-plugin.version>
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
<maven-archiver.version>2.5</maven-archiver.version>
<nifi-nar-maven-plugin.version>1.2.0</nifi-nar-maven-plugin.version>
<maven-checkstyle-plugin.version>3.0.0</maven-checkstyle-plugin.version>
<git-commit-id-plugin.version>3.0.0</git-commit-id-plugin.version>
<git-commit-id-plugin.version>4.0.2</git-commit-id-plugin.version>
<wagon-ssh-external.version>2.10</wagon-ssh-external.version>
<os-maven-plugin.version>1.4.1.Final</os-maven-plugin.version>
<jacoco-maven-plugin.version>0.8.3</jacoco-maven-plugin.version>
Expand Down Expand Up @@ -1283,30 +1284,7 @@ flexible messaging model and an intuitive client API.</description>
<exclude>**/_helpers.tpl</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<executions>
<execution>
<id>git-info</id>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<configuration>
<useNativeGit>true</useNativeGit>
<prefix>git</prefix>
<verbose>false</verbose>
<failOnNoGitDirectory>false</failOnNoGitDirectory>
<failOnUnableToExtractRepoInfo>false</failOnUnableToExtractRepoInfo>
<format>properties</format>
<gitDescribe>
<skip>true</skip>
</gitDescribe>
</configuration>
</plugin>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
Expand Down Expand Up @@ -1402,6 +1380,11 @@ flexible messaging model and an intuitive client API.</description>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pulsar-client-kafka-compat/pulsar-client-kafka/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>pulsar-client</artifactId>
<artifactId>pulsar-client-original</artifactId>
<version>${project.version}</version>
</dependency>

Expand Down
24 changes: 24 additions & 0 deletions pulsar-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,30 @@

<build>
<plugins>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<executions>
<execution>
<id>git-info</id>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<configuration>
<useNativeGit>true</useNativeGit>
<prefix>git</prefix>
<verbose>false</verbose>
<failOnNoGitDirectory>false</failOnNoGitDirectory>
<failOnUnableToExtractRepoInfo>false</failOnUnableToExtractRepoInfo>
<format>properties</format>
<gitDescribe>
<skip>true</skip>
</gitDescribe>
</configuration>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>templating-maven-plugin</artifactId>
Expand Down
34 changes: 20 additions & 14 deletions pulsar-sql/presto-distribution/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -235,18 +235,15 @@ The Apache Software License, Version 2.0
- netty-codec-4.1.51.Final.jar
- netty-codec-dns-4.1.51.Final.jar
- netty-codec-http-4.1.51.Final.jar
- netty-codec-socks-4.1.51.Final.jar
- netty-common-4.1.51.Final.jar
- netty-handler-4.1.51.Final.jar
- netty-handler-proxy-4.1.51.Final.jar
- netty-reactive-streams-2.0.4.jar
- netty-resolver-4.1.51.Final.jar
- netty-resolver-dns-4.1.51.Final.jar
- netty-tcnative-boringssl-static-2.0.30.Final.jar
- netty-transport-4.1.51.Final.jar
- netty-transport-native-epoll-4.1.51.Final.jar
- netty-transport-native-epoll-4.1.51.Final-linux-x86_64.jar
- netty-transport-native-kqueue-4.1.51.Final-osx-x86_64.jar
- netty-transport-native-unix-common-4.1.51.Final.jar
- netty-transport-native-unix-common-4.1.51.Final-linux-x86_64.jar
* Joda Time
Expand Down Expand Up @@ -500,7 +497,7 @@ MIT License

CDDL - 1.0
* OSGi Resource Locator
- osgi-resource-locator-1.0.1.jar
- osgi-resource-locator-1.0.3.jar

CDDL-1.1 -- licenses/LICENSE-CDDL-1.1.txt
* Java Annotations API
Expand All @@ -509,19 +506,28 @@ CDDL-1.1 -- licenses/LICENSE-CDDL-1.1.txt
- javax.activation-1.2.0.jar
- javax.activation-api-1.2.0.jar
- jakarta.activation-api-1.2.1.jar
- jakarta.validation-api-2.0.2.jar
- jakarta.ws.rs-api-2.1.6.jar
* HK2 - Dependency Injection Kernel
- hk2-api-2.5.0-b42.jar
- hk2-locator-2.5.0-b42.jar
- hk2-utils-2.5.0-b42.jar
- hk2-api-2.6.1.jar
- hk2-locator-2.6.1.jar
- hk2-utils-2.6.1.jar
- jakarta.inject-2.6.1.jar
* Jersey
- jaxrs-0.195.jar
- jersey-client-2.26.jar
- jersey-container-servlet-2.26.jar
- jersey-container-servlet-core-2.26.jar
- jersey-hk2-2.26.jar
- jersey-media-jaxb-2.26.jar
- jersey-server-2.26.jar
- jersey-common-2.26.jar
- jersey-client-2.31.jar
- jersey-container-servlet-2.31.jar
- jersey-container-servlet-core-2.31.jar
- jersey-hk2-2.31.jar
- jersey-media-jaxb-2.31.jar
- jersey-server-2.31.jar
- jersey-common-2.31.jar
- jersey-entity-filtering-2.31.jar
- jersey-hk2-2.31.jar
- jersey-media-json-jackson-2.31.jar
- jersey-media-multipart-2.31.jar
- aopalliance-repackaged-2.6.1.jar

* JAXB
- jaxb-api-2.3.1.jar

Expand Down
31 changes: 28 additions & 3 deletions pulsar-sql/presto-distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<version>2.7.0-SNAPSHOT</version>

<properties>
<jersey.version>2.31</jersey.version>
<presto.version>332</presto.version>
<airlift.version>0.170</airlift.version>
<objenesis.version>2.6</objenesis.version>
Expand All @@ -52,7 +53,31 @@
</properties>

<dependencies>

<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-common</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>io.prestosql</groupId>
<artifactId>presto-main</artifactId>
Expand Down Expand Up @@ -180,7 +205,7 @@
</dependency>

</dependencies>

<dependencyManagement>
<dependencies>
<dependency>
Expand All @@ -193,7 +218,7 @@
<artifactId>netty</artifactId>
<version>3.10.6.Final</version>
</dependency>

<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion src/check-binary-license
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ for J in $NOTICEJARS; do
done

# check pulsar sql jars
JARS=$(tar -tf $TARBALL | grep '\.jar' | grep 'lib/presto/' | grep -v 'managed-ledger' | grep -v 'pulsar-client-admin' | grep -v 'pulsar-client-api' | grep -v 'pulsar-functions-api' | grep -v 'pulsar-presto-connector-original' | grep -v 'pulsar-presto-distribution' | grep -v 'pulsar-common' | grep -v 'pulsar-functions-proto' | grep -v 'pulsar-functions-utils' | grep -v 'pulsar-io-core' | grep -v 'pulsar-transaction-common' | sed 's!.*/!!' | sort)
JARS=$(tar -tf $TARBALL | grep '\.jar' | grep 'lib/presto/' | grep -v pulsar-client | grep -v pulsar-metadata | grep -v 'managed-ledger' | grep -v 'pulsar-client-admin' | grep -v 'pulsar-client-api' | grep -v 'pulsar-functions-api' | grep -v 'pulsar-presto-connector-original' | grep -v 'pulsar-presto-distribution' | grep -v 'pulsar-common' | grep -v 'pulsar-functions-proto' | grep -v 'pulsar-functions-utils' | grep -v 'pulsar-io-core' | grep -v 'pulsar-transaction-common' | sed 's!.*/!!' | sort)
LICENSEPATH=$(tar -tf $TARBALL | awk '/^[^\/]*\/lib\/presto\/LICENSE/')
LICENSE=$(tar -O -xf $TARBALL "$LICENSEPATH")
LICENSEJARS=$(echo "$LICENSE" | sed -nE 's!.* (.*\.jar).*!\1!gp')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.Producer;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.apache.kafka.clients.producer.PulsarKafkaProducer;
import org.apache.kafka.common.serialization.IntegerSerializer;
import org.apache.kafka.common.serialization.StringSerializer;
import org.apache.pulsar.tests.integration.suites.PulsarStandaloneTestSuite;
Expand Down

0 comments on commit b527ccc

Please sign in to comment.