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

gyfora pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/flink-kubernetes-operator.git


The following commit(s) were added to refs/heads/main by this push:
     new c821b48a [FLINK-36332] Fix okhttp dependency handling
c821b48a is described below

commit c821b48a75c601c3a64bc03bfbada218a68a0e0d
Author: Sam Barker <[email protected]>
AuthorDate: Sat Nov 2 21:43:24 2024 +1300

    [FLINK-36332] Fix okhttp dependency handling
---
 flink-kubernetes-operator-api/pom.xml | 18 +++++---------
 flink-kubernetes-operator/pom.xml     | 18 --------------
 flink-kubernetes-webhook/pom.xml      | 18 +-------------
 pom.xml                               | 44 +++++++++++++++++++++++++++++++++++
 4 files changed, 51 insertions(+), 47 deletions(-)

diff --git a/flink-kubernetes-operator-api/pom.xml 
b/flink-kubernetes-operator-api/pom.xml
index 119d883b..5baa6ee9 100644
--- a/flink-kubernetes-operator-api/pom.xml
+++ b/flink-kubernetes-operator-api/pom.xml
@@ -66,19 +66,8 @@ under the License.
         <dependency>
             <groupId>io.fabric8</groupId>
             <artifactId>kubernetes-client</artifactId>
-            <version>${fabric8.version}</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>com.squareup.okhttp3</groupId>
-                    <artifactId>*</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>io.fabric8</groupId>
-                    <artifactId>kubernetes-httpclient-okhttp</artifactId>
-                </exclusion>
-            </exclusions>
         </dependency>
-
+        
         <!-- Utils -->
         <dependency>
             <groupId>org.apache.commons</groupId>
@@ -112,6 +101,11 @@ under the License.
             <version>${log4j.version}</version>
         </dependency>
 
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-annotations</artifactId>
+        </dependency>
+
         <!-- Test -->
         <dependency>
             <groupId>org.apache.flink</groupId>
diff --git a/flink-kubernetes-operator/pom.xml 
b/flink-kubernetes-operator/pom.xml
index 7d0378ba..b9ec48cd 100644
--- a/flink-kubernetes-operator/pom.xml
+++ b/flink-kubernetes-operator/pom.xml
@@ -37,8 +37,6 @@ under the License.
             <!-- required by FlinkConfigManagerTest -->
             --add-opens=java.base/java.util=ALL-UNNAMED
         </surefire.module.config>
-        <!-- valid options can be checked at 
https://central.sonatype.com/search?q=kubernetes-httpclient- currently: okhttp, 
jdk, jetty, vertx -->
-        <fabric8.httpclient.impl>okhttp</fabric8.httpclient.impl>
     </properties>
 
     <dependencies>
@@ -421,22 +419,6 @@ under the License.
                 </plugins>
             </build>
         </profile>
-        <profile>
-            <id>depend-on-okhttp4</id>
-            <activation>
-                <property>
-                    <name>fabric8.httpclient.impl</name>
-                    <value>okhttp</value>
-                </property>
-            </activation>
-            <dependencies>
-                <dependency>
-                    <groupId>com.squareup.okhttp3</groupId>
-                    <artifactId>okhttp</artifactId>
-                    <version>${okhttp.version}</version>
-                </dependency>
-            </dependencies>
-        </profile>
     </profiles>
 
 </project>
diff --git a/flink-kubernetes-webhook/pom.xml b/flink-kubernetes-webhook/pom.xml
index eb70ff7b..307b4963 100644
--- a/flink-kubernetes-webhook/pom.xml
+++ b/flink-kubernetes-webhook/pom.xml
@@ -24,7 +24,7 @@ under the License.
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-kubernetes-operator-parent</artifactId>
         <version>1.11-SNAPSHOT</version>
-        <relativePath>..</relativePath>
+        <relativePath>../pom.xml</relativePath>
     </parent>
 
     <artifactId>flink-kubernetes-webhook</artifactId>
@@ -78,22 +78,6 @@ under the License.
             <scope>test</scope>
         </dependency>
 
-        <!-- okhttp -->
-        <!--
-            Regarding the okhttp explicit version
-            see https://github.com/fabric8io/kubernetes-client/issues/4290
-            and https://issues.apache.org/jira/browse/FLINK-28637
-            -->
-        <dependency>
-            <groupId>com.squareup.okhttp3</groupId>
-            <artifactId>okhttp</artifactId>
-            <version>${okhttp.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>com.squareup.okhttp3</groupId>
-            <artifactId>logging-interceptor</artifactId>
-            <version>${okhttp.version}</version>
-        </dependency>
         <dependency>
             <groupId>com.squareup.okhttp3</groupId>
             <artifactId>mockwebserver</artifactId>
diff --git a/pom.xml b/pom.xml
index 78230277..052b211a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -111,6 +111,10 @@ under the License.
 
         <derby.version>10.15.2.0</derby.version>
         <awaitility.version>4.2.2</awaitility.version>
+
+        <!-- valid options can be checked at 
https://central.sonatype.com/search?q=kubernetes-httpclient- currently: okhttp, 
jdk, jetty, vertx -->
+        <!-- when using a value other than okhttp disable the 
`depend-on-okhttp4` profile as well. -->
+        <fabric8.httpclient.impl>okhttp</fabric8.httpclient.impl>
     </properties>
 
     <dependencyManagement>
@@ -129,6 +133,33 @@ under the License.
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
+            <dependency>
+                <groupId>io.fabric8</groupId>
+                <artifactId>kubernetes-client</artifactId>
+                <version>${fabric8.version}</version>
+                <exclusions>
+                    <exclusion>
+                        <groupId>com.squareup.okhttp3</groupId>
+                        <artifactId>*</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>io.fabric8</groupId>
+                        <artifactId>kubernetes-httpclient-okhttp</artifactId>
+                    </exclusion>
+                </exclusions>
+            </dependency>
+            <dependency>
+                <groupId>io.fabric8</groupId>
+                <artifactId>kubernetes-server-mock</artifactId>
+                <version>${fabric8.version}</version>
+                <scope>test</scope>
+                <exclusions>
+                    <exclusion>
+                        <groupId>com.squareup.okhttp3</groupId>
+                        <artifactId>mockwebserver</artifactId>
+                    </exclusion>
+                </exclusions>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 
@@ -189,6 +220,19 @@ under the License.
                 </plugins>
             </build>
         </profile>
+        <profile>
+            <id>depend-on-okhttp4</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <dependencies>
+                <dependency>
+                    <groupId>com.squareup.okhttp3</groupId>
+                    <artifactId>okhttp</artifactId>
+                    <version>${okhttp.version}</version>
+                </dependency>
+            </dependencies>
+        </profile>
     </profiles>
 
     <build>

Reply via email to