You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pegasus.apache.org by wa...@apache.org on 2022/11/29 01:42:22 UTC

[incubator-pegasus] branch master updated: build(pom): use --release when building java client with java11+ (#1256)

This is an automated email from the ASF dual-hosted git repository.

wangdan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pegasus.git


The following commit(s) were added to refs/heads/master by this push:
     new 9cb11f90b build(pom): use --release when building java client with java11+ (#1256)
9cb11f90b is described below

commit 9cb11f90b46809802efecc37983ea81c34be8ffe
Author: Duo Zhang <pa...@gmail.com>
AuthorDate: Tue Nov 29 09:42:17 2022 +0800

    build(pom): use --release when building java client with java11+ (#1256)
---
 java-client/pom.xml | 43 ++++++++++++++++++++++++++++++++++++-------
 1 file changed, 36 insertions(+), 7 deletions(-)

diff --git a/java-client/pom.xml b/java-client/pom.xml
index a641d0442..bb85a135a 100644
--- a/java-client/pom.xml
+++ b/java-client/pom.xml
@@ -49,7 +49,9 @@
 
   <properties>
     <pegasus.shade.name>org.apache.pegasus.thirdparty</pegasus.shade.name>
-
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <compileSource>1.8</compileSource>
+    <releaseTarget>8</releaseTarget>
     <junit.engine.version>5.3.2</junit.engine.version>
     <junit.platform.runner.version>1.3.0</junit.platform.runner.version>
     <guava.version>28.1-jre</guava.version>
@@ -166,6 +168,37 @@
       </plugin>
     </plugins>
   </reporting>
+  <profiles>
+    <profile>
+      <id>build-with-jdk8</id>
+      <activation>
+        <jdk>1.8</jdk>
+      </activation>
+      <properties>
+        <maven.compiler.source>${compileSource}</maven.compiler.source>
+        <maven.compiler.target>${compileSource}</maven.compiler.target>
+      </properties>
+    </profile>
+    <profile>
+      <id>build-with-jdk11</id>
+      <activation>
+        <jdk>[11,)</jdk>
+      </activation>
+      <properties>
+        <maven.compiler.release>${releaseTarget}</maven.compiler.release>
+        <argLine>-Dio.netty.tryReflectionSetAccessible=true
+          --add-modules jdk.unsupported
+          --add-opens java.base/java.nio=ALL-UNNAMED
+          --add-opens java.base/sun.nio.ch=ALL-UNNAMED
+          --add-opens java.base/java.lang=ALL-UNNAMED
+          --add-opens java.base/jdk.internal.ref=ALL-UNNAMED
+          --add-opens java.base/java.lang.reflect=ALL-UNNAMED
+          --add-exports java.base/jdk.internal.misc=ALL-UNNAMED
+          --add-exports java.security.jgss/sun.security.krb5=ALL-UNNAMED
+          </argLine>
+      </properties>
+    </profile>
+  </profiles>
   <build>
     <sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
     <testSourceDirectory>${project.basedir}/src/test/java</testSourceDirectory>
@@ -214,21 +247,17 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
-        <version>3.5.1</version>
+        <version>3.10.1</version>
         <configuration>
-          <source>1.8</source>
-          <target>1.8</target>
           <fork>true</fork>
           <verbose>true</verbose>
-          <encoding>UTF-8</encoding>
         </configuration>
       </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
-        <version>2.19.1</version>
+        <version>3.0.0-M7</version>
         <configuration>
-          <skipTests>${skipTests}</skipTests>
           <additionalClasspathElements>
             <additionalClasspathElement>${project.basedir}/configuration</additionalClasspathElement>
           </additionalClasspathElements>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pegasus.apache.org
For additional commands, e-mail: commits-help@pegasus.apache.org