From e8046b5415050b3ebd2f373466831b2eb6906752 Mon Sep 17 00:00:00 2001
From: Dmitri Karpovich <dmitri.karpovich@gmail.com>
Date: Thu, 6 Jun 2024 13:59:41 +0200
Subject: [PATCH 1/3] [general] Add maven-enforcer-plugin to build

---
 pom.xml                               | 21 +++++++++++++++++++++
 xchange-examples/pom.xml              |  7 +++++++
 xchange-stream-bitflyer/pom.xml       | 13 +++++++++++++
 xchange-stream-service-pubnub/pom.xml | 12 ++++++++++++
 4 files changed, 53 insertions(+)

diff --git a/pom.xml b/pom.xml
index 405079c72f7..b57c6057e8b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -207,6 +207,7 @@
         <version.junit>5.10.2</version.junit>
         <version.knowm.xchart>3.8.8</version.knowm.xchart>
         <version.lombok>1.18.32</version.lombok>
+        <version.maven-enforcer-plugin>3.2.1</version.maven-enforcer-plugin>
         <version.mockito>5.11.0</version.mockito>
         <version.qos.logback>1.5.6</version.qos.logback>
         <version.reflections>0.10.2</version.reflections>
@@ -485,6 +486,26 @@
                 </configuration>
             </plugin>
 
+            <plugin>
+                <artifactId>maven-enforcer-plugin</artifactId>
+                <version>${version.maven-enforcer-plugin}</version>
+                <executions>
+                    <execution>
+                        <id>enforce</id>
+                        <goals>
+                            <goal>enforce</goal>
+                        </goals>
+                        <configuration>
+                            <rules>
+                                <dependencyConvergence/>
+                                <banDuplicatePomDependencyVersions/>
+                                <reactorModuleConvergence/>
+                            </rules>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-failsafe-plugin</artifactId>
diff --git a/xchange-examples/pom.xml b/xchange-examples/pom.xml
index 8d146ba9865..04799f32d7d 100755
--- a/xchange-examples/pom.xml
+++ b/xchange-examples/pom.xml
@@ -343,9 +343,16 @@
             <artifactId>xchange-lgo</artifactId>
             <version>${project.version}</version>
         </dependency>
+
         <dependency>
             <groupId>org.knowm.xchart</groupId>
             <artifactId>xchart</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.junit.jupiter</groupId>
+                    <artifactId>junit-jupiter</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
 
         <dependency>
diff --git a/xchange-stream-bitflyer/pom.xml b/xchange-stream-bitflyer/pom.xml
index 4775cf90c9a..93faa1a897f 100644
--- a/xchange-stream-bitflyer/pom.xml
+++ b/xchange-stream-bitflyer/pom.xml
@@ -29,4 +29,17 @@
             <version>${project.parent.version}</version>
         </dependency>
     </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-enforcer-plugin</artifactId>
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+            </plugin>
+
+        </plugins>
+    </build>
+
 </project>
diff --git a/xchange-stream-service-pubnub/pom.xml b/xchange-stream-service-pubnub/pom.xml
index 7195399a9d4..1becfe32de1 100644
--- a/xchange-stream-service-pubnub/pom.xml
+++ b/xchange-stream-service-pubnub/pom.xml
@@ -29,4 +29,16 @@
         </dependency>
     </dependencies>
 
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-enforcer-plugin</artifactId>
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+            </plugin>
+
+        </plugins>
+    </build>
+
 </project>

From 7816ef79d411ed1e37c766b62b1d00e99e4d8d7f Mon Sep 17 00:00:00 2001
From: Dmitri Karpovich <dmitri.karpovich@gmail.com>
Date: Fri, 7 Jun 2024 12:31:52 +0200
Subject: [PATCH 2/3] [general] Fix minimal maven version warning

---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index b57c6057e8b..455ff35818c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -35,10 +35,6 @@
         </developer>
     </developers>
 
-    <prerequisites>
-        <maven>3.0</maven>
-    </prerequisites>
-
     <modules>
         <module>xchange-ascendex</module>
         <module>xchange-bibox</module>
@@ -208,6 +204,7 @@
         <version.knowm.xchart>3.8.8</version.knowm.xchart>
         <version.lombok>1.18.32</version.lombok>
         <version.maven-enforcer-plugin>3.2.1</version.maven-enforcer-plugin>
+        <version.maven-prerequisite>3.0</version.maven-prerequisite>
         <version.mockito>5.11.0</version.mockito>
         <version.qos.logback>1.5.6</version.qos.logback>
         <version.reflections>0.10.2</version.reflections>
@@ -497,6 +494,9 @@
                         </goals>
                         <configuration>
                             <rules>
+                                <requireMavenVersion>
+                                    <version>${version.maven-prerequisite}</version>
+                                </requireMavenVersion>
                                 <dependencyConvergence/>
                                 <banDuplicatePomDependencyVersions/>
                                 <reactorModuleConvergence/>

From 9f3cee03171aed914cee78ac1b4b1a88e04a7aa8 Mon Sep 17 00:00:00 2001
From: Dmitri Karpovich <dmitri.karpovich@gmail.com>
Date: Fri, 7 Jun 2024 14:13:59 +0200
Subject: [PATCH 3/3] Update minimal required maven version

---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 455ff35818c..0447fc6bedb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -204,7 +204,7 @@
         <version.knowm.xchart>3.8.8</version.knowm.xchart>
         <version.lombok>1.18.32</version.lombok>
         <version.maven-enforcer-plugin>3.2.1</version.maven-enforcer-plugin>
-        <version.maven-prerequisite>3.0</version.maven-prerequisite>
+        <version.maven-prerequisite>3.6.3</version.maven-prerequisite>
         <version.mockito>5.11.0</version.mockito>
         <version.qos.logback>1.5.6</version.qos.logback>
         <version.reflections>0.10.2</version.reflections>