You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by jo...@apache.org on 2023/01/23 18:39:59 UTC
[nifi] branch main updated: NIFI-10580 This closes #6867. Upgraded SLF4J from 1.7.36 to 2.0.6
This is an automated email from the ASF dual-hosted git repository.
joewitt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/main by this push:
new 972667461b NIFI-10580 This closes #6867. Upgraded SLF4J from 1.7.36 to 2.0.6
972667461b is described below
commit 972667461bde6faa88ff6f5f23680843a76b0b8e
Author: exceptionfactory <ex...@apache.org>
AuthorDate: Thu Jan 19 13:02:35 2023 -0600
NIFI-10580 This closes #6867. Upgraded SLF4J from 1.7.36 to 2.0.6
- Upgraded Logback from 1.2.11 to 1.3.5
- Updated Logback DelayingShutdownHook to DefaultShutdownHook
- Disabled Spring Boot Logging System in favor of standard Logback initialization
- Excluded logback-classic from ZooKeeper and other dependencies to avoid conflicts when running tests
- Excluded spring-boot-starter-logging to avoid failures related to Logback 1.2 and Spring Boot 2.7
- Removed ZooKeeperMigratorTest.groovy based on Apache Curator test server usage of Logback 1.2
NIFI-10580 Added logback-core as explicit dependency
- Set logback-core as provided in root configuration
- Added logback-core as compile dependency in assembly configurations
Signed-off-by: Joe Witt <jo...@apache.org>
---
minifi/minifi-assembly/pom.xml | 5 +
.../main/assembly/dependencies-windows-service.xml | 1 +
.../src/main/assembly/dependencies.xml | 1 +
minifi/minifi-c2/minifi-c2-assembly/pom.xml | 5 +
nifi-assembly/pom.xml | 5 +
nifi-assembly/src/main/assembly/common.xml | 1 +
nifi-nar-bundles/nifi-accumulo-bundle/pom.xml | 6 +
.../src/main/resources/conf/logback.xml | 2 +-
nifi-nar-bundles/nifi-hive-bundle/pom.xml | 6 +
nifi-nar-bundles/nifi-iceberg-bundle/pom.xml | 6 +
.../nifi-ranger-bundle/nifi-ranger-plugin/pom.xml | 8 +
nifi-nar-bundles/nifi-spark-bundle/pom.xml | 6 +
.../nifi-hbase_1_1_2-client-service-bundle/pom.xml | 6 +
.../nifi-hbase_2-client-service-bundle/pom.xml | 6 +
nifi-registry/nifi-registry-assembly/pom.xml | 5 +
.../src/main/assembly/dependencies.xml | 1 +
.../nifi-registry-framework/pom.xml | 7 +
.../nifi-registry-core/nifi-registry-test/pom.xml | 7 +
.../nifi-registry-web-api/pom.xml | 7 +
.../nifi/registry/NiFiRegistryApiApplication.java | 6 +
.../nifi-registry-ranger-plugin/pom.xml | 8 +
.../nifi-registry-toolkit-assembly/pom.xml | 4 +
nifi-stateless/nifi-stateless-assembly/pom.xml | 5 +
nifi-system-tests/nifi-system-test-suite/pom.xml | 5 +
.../resources/conf/clustered/node1/logback.xml | 2 +-
.../resources/conf/clustered/node2/logback.xml | 2 +-
.../src/test/resources/conf/default/logback.xml | 2 +-
.../zkmigrator/ZooKeeperMigratorTest.groovy | 296 ---------------------
pom.xml | 10 +-
29 files changed, 129 insertions(+), 302 deletions(-)
diff --git a/minifi/minifi-assembly/pom.xml b/minifi/minifi-assembly/pom.xml
index b31d96385b..74c03fd9c0 100644
--- a/minifi/minifi-assembly/pom.xml
+++ b/minifi/minifi-assembly/pom.xml
@@ -69,6 +69,11 @@ limitations under the License.
<artifactId>logback-classic</artifactId>
<scope>compile</scope>
</dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-core</artifactId>
+ <scope>compile</scope>
+ </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
diff --git a/minifi/minifi-assembly/src/main/assembly/dependencies-windows-service.xml b/minifi/minifi-assembly/src/main/assembly/dependencies-windows-service.xml
index af9e6bd252..754fdb49d4 100644
--- a/minifi/minifi-assembly/src/main/assembly/dependencies-windows-service.xml
+++ b/minifi/minifi-assembly/src/main/assembly/dependencies-windows-service.xml
@@ -63,6 +63,7 @@
<include>*:commons-io</include>
<include>*:slf4j-api</include>
<include>*:logback-classic</include>
+ <include>*:logback-core</include>
</includes>
</dependencySet>
diff --git a/minifi/minifi-assembly/src/main/assembly/dependencies.xml b/minifi/minifi-assembly/src/main/assembly/dependencies.xml
index 8fbd0d51cb..342b520ab3 100644
--- a/minifi/minifi-assembly/src/main/assembly/dependencies.xml
+++ b/minifi/minifi-assembly/src/main/assembly/dependencies.xml
@@ -64,6 +64,7 @@
<include>*:commons-lang3</include>
<include>*:slf4j-api</include>
<include>*:logback-classic</include>
+ <include>*:logback-core</include>
</includes>
</dependencySet>
diff --git a/minifi/minifi-c2/minifi-c2-assembly/pom.xml b/minifi/minifi-c2/minifi-c2-assembly/pom.xml
index 277bdaa667..3ab4d643d8 100644
--- a/minifi/minifi-c2/minifi-c2-assembly/pom.xml
+++ b/minifi/minifi-c2/minifi-c2-assembly/pom.xml
@@ -164,6 +164,11 @@ limitations under the License.
<artifactId>logback-classic</artifactId>
<scope>compile</scope>
</dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-core</artifactId>
+ <scope>compile</scope>
+ </dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
diff --git a/nifi-assembly/pom.xml b/nifi-assembly/pom.xml
index 38f0d08b60..9cdb654ac4 100644
--- a/nifi-assembly/pom.xml
+++ b/nifi-assembly/pom.xml
@@ -113,6 +113,11 @@ language governing permissions and limitations under the License. -->
<artifactId>logback-classic</artifactId>
<scope>compile</scope>
</dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-core</artifactId>
+ <scope>compile</scope>
+ </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
diff --git a/nifi-assembly/src/main/assembly/common.xml b/nifi-assembly/src/main/assembly/common.xml
index 9ef7087a6d..b193ed9afb 100644
--- a/nifi-assembly/src/main/assembly/common.xml
+++ b/nifi-assembly/src/main/assembly/common.xml
@@ -28,6 +28,7 @@
<include>*:nifi-bootstrap</include>
<include>*:slf4j-api</include>
<include>*:logback-classic</include>
+ <include>*:logback-core</include>
<include>*:nifi-api</include>
<include>*:nifi-property-protection-api</include>
</includes>
diff --git a/nifi-nar-bundles/nifi-accumulo-bundle/pom.xml b/nifi-nar-bundles/nifi-accumulo-bundle/pom.xml
index 1ae40966b3..aea703b499 100644
--- a/nifi-nar-bundles/nifi-accumulo-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-accumulo-bundle/pom.xml
@@ -63,6 +63,12 @@
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>${zookeeper.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<!-- Override commons-configuration2:2.5 from accumulo-core -->
<dependency>
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/logback.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/logback.xml
index c578c8ba3d..4a1e57e1f5 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/logback.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/logback.xml
@@ -15,7 +15,7 @@
-->
<configuration scan="true" scanPeriod="30 seconds">
- <shutdownHook class="ch.qos.logback.core.hook.DelayingShutdownHook" />
+ <shutdownHook class="ch.qos.logback.core.hook.DefaultShutdownHook" />
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL>
diff --git a/nifi-nar-bundles/nifi-hive-bundle/pom.xml b/nifi-nar-bundles/nifi-hive-bundle/pom.xml
index d68df4321d..80c88ba728 100644
--- a/nifi-nar-bundles/nifi-hive-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-hive-bundle/pom.xml
@@ -90,6 +90,12 @@
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>${zookeeper.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<!-- Override ant -->
<dependency>
diff --git a/nifi-nar-bundles/nifi-iceberg-bundle/pom.xml b/nifi-nar-bundles/nifi-iceberg-bundle/pom.xml
index 139eba8cb0..c7677a1105 100644
--- a/nifi-nar-bundles/nifi-iceberg-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-iceberg-bundle/pom.xml
@@ -75,6 +75,12 @@
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>${zookeeper.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<!-- Override ant -->
<dependency>
diff --git a/nifi-nar-bundles/nifi-ranger-bundle/nifi-ranger-plugin/pom.xml b/nifi-nar-bundles/nifi-ranger-bundle/nifi-ranger-plugin/pom.xml
index 548b2c7ecd..f1cb4fd37d 100644
--- a/nifi-nar-bundles/nifi-ranger-bundle/nifi-ranger-plugin/pom.xml
+++ b/nifi-nar-bundles/nifi-ranger-bundle/nifi-ranger-plugin/pom.xml
@@ -62,6 +62,10 @@
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
@@ -163,6 +167,10 @@
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
diff --git a/nifi-nar-bundles/nifi-spark-bundle/pom.xml b/nifi-nar-bundles/nifi-spark-bundle/pom.xml
index 87f15877b0..394abbd5c8 100644
--- a/nifi-nar-bundles/nifi-spark-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-spark-bundle/pom.xml
@@ -74,6 +74,12 @@
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>${zookeeper.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
</dependencies>
</dependencyManagement>
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/pom.xml
index 73ee56d428..1fec56d363 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/pom.xml
@@ -102,6 +102,12 @@
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>${zookeeper.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
</dependencies>
</dependencyManagement>
diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-hbase_2-client-service-bundle/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-hbase_2-client-service-bundle/pom.xml
index 9bc352bdc7..3717c02bd2 100644
--- a/nifi-nar-bundles/nifi-standard-services/nifi-hbase_2-client-service-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-services/nifi-hbase_2-client-service-bundle/pom.xml
@@ -72,6 +72,12 @@
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>${zookeeper.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
</dependencies>
</dependencyManagement>
diff --git a/nifi-registry/nifi-registry-assembly/pom.xml b/nifi-registry/nifi-registry-assembly/pom.xml
index 3f180efc24..200db073d8 100644
--- a/nifi-registry/nifi-registry-assembly/pom.xml
+++ b/nifi-registry/nifi-registry-assembly/pom.xml
@@ -64,6 +64,11 @@
<artifactId>logback-classic</artifactId>
<scope>compile</scope>
</dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-core</artifactId>
+ <scope>compile</scope>
+ </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
diff --git a/nifi-registry/nifi-registry-assembly/src/main/assembly/dependencies.xml b/nifi-registry/nifi-registry-assembly/src/main/assembly/dependencies.xml
index a364cb277d..53198dd4b1 100644
--- a/nifi-registry/nifi-registry-assembly/src/main/assembly/dependencies.xml
+++ b/nifi-registry/nifi-registry-assembly/src/main/assembly/dependencies.xml
@@ -50,6 +50,7 @@
<include>*:nifi-registry-bootstrap</include>
<include>*:slf4j-api</include>
<include>*:logback-classic</include>
+ <include>*:logback-core</include>
</includes>
</dependencySet>
diff --git a/nifi-registry/nifi-registry-core/nifi-registry-framework/pom.xml b/nifi-registry/nifi-registry-core/nifi-registry-framework/pom.xml
index aeaa7602bf..286f0de88d 100644
--- a/nifi-registry/nifi-registry-core/nifi-registry-framework/pom.xml
+++ b/nifi-registry/nifi-registry-core/nifi-registry-framework/pom.xml
@@ -231,6 +231,13 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
<version>${spring.boot.version}</version>
+ <exclusions>
+ <!-- Spring Boot Starter Logging 2 does not support Logback 1.3 -->
+ <exclusion>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-logging</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
diff --git a/nifi-registry/nifi-registry-core/nifi-registry-test/pom.xml b/nifi-registry/nifi-registry-core/nifi-registry-test/pom.xml
index 4e2067d36f..7684bb853d 100644
--- a/nifi-registry/nifi-registry-core/nifi-registry-test/pom.xml
+++ b/nifi-registry/nifi-registry-core/nifi-registry-test/pom.xml
@@ -36,6 +36,13 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring.boot.version}</version>
+ <exclusions>
+ <!-- Spring Boot Starter Logging 2 does not support Logback 1.3 -->
+ <exclusion>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-logging</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
diff --git a/nifi-registry/nifi-registry-core/nifi-registry-web-api/pom.xml b/nifi-registry/nifi-registry-core/nifi-registry-web-api/pom.xml
index ae71667c81..fc204b1158 100644
--- a/nifi-registry/nifi-registry-core/nifi-registry-web-api/pom.xml
+++ b/nifi-registry/nifi-registry-core/nifi-registry-web-api/pom.xml
@@ -284,6 +284,13 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring.boot.version}</version>
+ <exclusions>
+ <!-- Spring Boot Starter Logging 2 does not support Logback 1.3 -->
+ <exclusion>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-logging</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
diff --git a/nifi-registry/nifi-registry-core/nifi-registry-web-api/src/main/java/org/apache/nifi/registry/NiFiRegistryApiApplication.java b/nifi-registry/nifi-registry-core/nifi-registry-web-api/src/main/java/org/apache/nifi/registry/NiFiRegistryApiApplication.java
index 14ca1672bb..7accea2a06 100644
--- a/nifi-registry/nifi-registry-core/nifi-registry-web-api/src/main/java/org/apache/nifi/registry/NiFiRegistryApiApplication.java
+++ b/nifi-registry/nifi-registry-core/nifi-registry-web-api/src/main/java/org/apache/nifi/registry/NiFiRegistryApiApplication.java
@@ -28,6 +28,7 @@ import org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestCli
import org.springframework.boot.autoconfigure.solr.SolrAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.event.ApplicationReadyEvent;
+import org.springframework.boot.logging.LoggingSystem;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
@@ -56,6 +57,11 @@ public class NiFiRegistryApiApplication extends SpringBootServletInitializer {
public static final String NIFI_REGISTRY_PROPERTIES_ATTRIBUTE = "nifi-registry.properties";
public static final String NIFI_REGISTRY_MASTER_KEY_ATTRIBUTE = "nifi-registry.key";
+ static {
+ // Disable Spring Logging abstraction for Spring Boot 2 and SLF4J 2
+ System.setProperty(LoggingSystem.SYSTEM_PROPERTY, LoggingSystem.NONE);
+ }
+
@Autowired
private EventService eventService;
diff --git a/nifi-registry/nifi-registry-extensions/nifi-registry-ranger/nifi-registry-ranger-plugin/pom.xml b/nifi-registry/nifi-registry-extensions/nifi-registry-ranger/nifi-registry-ranger-plugin/pom.xml
index bc9a71f2bc..87efeefd6e 100644
--- a/nifi-registry/nifi-registry-extensions/nifi-registry-ranger/nifi-registry-ranger-plugin/pom.xml
+++ b/nifi-registry/nifi-registry-extensions/nifi-registry-ranger/nifi-registry-ranger-plugin/pom.xml
@@ -97,6 +97,10 @@
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ </exclusion>
<exclusion>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
@@ -239,6 +243,10 @@
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
diff --git a/nifi-registry/nifi-registry-toolkit/nifi-registry-toolkit-assembly/pom.xml b/nifi-registry/nifi-registry-toolkit/nifi-registry-toolkit-assembly/pom.xml
index 53f198a094..fdb59b4ff0 100644
--- a/nifi-registry/nifi-registry-toolkit/nifi-registry-toolkit-assembly/pom.xml
+++ b/nifi-registry/nifi-registry-toolkit/nifi-registry-toolkit-assembly/pom.xml
@@ -65,6 +65,10 @@ language governing permissions and limitations under the License. -->
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-core</artifactId>
+ </dependency>
</dependencies>
<profiles>
<profile>
diff --git a/nifi-stateless/nifi-stateless-assembly/pom.xml b/nifi-stateless/nifi-stateless-assembly/pom.xml
index 0aa320c08e..5d0a32a888 100644
--- a/nifi-stateless/nifi-stateless-assembly/pom.xml
+++ b/nifi-stateless/nifi-stateless-assembly/pom.xml
@@ -85,6 +85,11 @@
<artifactId>logback-classic</artifactId>
<scope>compile</scope>
</dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-core</artifactId>
+ <scope>compile</scope>
+ </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
diff --git a/nifi-system-tests/nifi-system-test-suite/pom.xml b/nifi-system-tests/nifi-system-test-suite/pom.xml
index 8d43652fb1..118d23c049 100644
--- a/nifi-system-tests/nifi-system-test-suite/pom.xml
+++ b/nifi-system-tests/nifi-system-test-suite/pom.xml
@@ -152,6 +152,11 @@
<artifactId>logback-classic</artifactId>
<scope>compile</scope>
</dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-core</artifactId>
+ <scope>compile</scope>
+ </dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-api</artifactId>
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/resources/conf/clustered/node1/logback.xml b/nifi-system-tests/nifi-system-test-suite/src/test/resources/conf/clustered/node1/logback.xml
index b48ab12d18..773e9a9635 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/resources/conf/clustered/node1/logback.xml
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/resources/conf/clustered/node1/logback.xml
@@ -15,7 +15,7 @@
-->
<configuration scan="true" scanPeriod="30 seconds">
- <shutdownHook class="ch.qos.logback.core.hook.DelayingShutdownHook" />
+ <shutdownHook class="ch.qos.logback.core.hook.DefaultShutdownHook" />
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL>
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/resources/conf/clustered/node2/logback.xml b/nifi-system-tests/nifi-system-test-suite/src/test/resources/conf/clustered/node2/logback.xml
index b48ab12d18..773e9a9635 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/resources/conf/clustered/node2/logback.xml
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/resources/conf/clustered/node2/logback.xml
@@ -15,7 +15,7 @@
-->
<configuration scan="true" scanPeriod="30 seconds">
- <shutdownHook class="ch.qos.logback.core.hook.DelayingShutdownHook" />
+ <shutdownHook class="ch.qos.logback.core.hook.DefaultShutdownHook" />
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL>
diff --git a/nifi-system-tests/nifi-system-test-suite/src/test/resources/conf/default/logback.xml b/nifi-system-tests/nifi-system-test-suite/src/test/resources/conf/default/logback.xml
index 65665cebf9..9471514f10 100644
--- a/nifi-system-tests/nifi-system-test-suite/src/test/resources/conf/default/logback.xml
+++ b/nifi-system-tests/nifi-system-test-suite/src/test/resources/conf/default/logback.xml
@@ -15,7 +15,7 @@
-->
<configuration scan="true" scanPeriod="30 seconds">
- <shutdownHook class="ch.qos.logback.core.hook.DelayingShutdownHook" />
+ <shutdownHook class="ch.qos.logback.core.hook.DefaultShutdownHook" />
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL>
diff --git a/nifi-toolkit/nifi-toolkit-zookeeper-migrator/src/test/groovy/org/apache/nifi/toolkit/zkmigrator/ZooKeeperMigratorTest.groovy b/nifi-toolkit/nifi-toolkit-zookeeper-migrator/src/test/groovy/org/apache/nifi/toolkit/zkmigrator/ZooKeeperMigratorTest.groovy
deleted file mode 100644
index fcbb0ab730..0000000000
--- a/nifi-toolkit/nifi-toolkit-zookeeper-migrator/src/test/groovy/org/apache/nifi/toolkit/zkmigrator/ZooKeeperMigratorTest.groovy
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * 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.nifi.toolkit.zkmigrator
-
-import com.google.gson.Gson
-import com.google.gson.stream.JsonReader
-import org.apache.curator.test.TestingServer
-import org.apache.curator.utils.ZKPaths
-import org.apache.zookeeper.CreateMode
-import org.apache.zookeeper.WatchedEvent
-import org.apache.zookeeper.ZKUtil
-import org.apache.zookeeper.ZooDefs
-import org.apache.zookeeper.ZooKeeper
-import org.apache.zookeeper.data.Stat
-import org.apache.zookeeper.server.auth.DigestAuthenticationProvider
-import spock.lang.Ignore
-import spock.lang.Specification
-import spock.lang.Unroll
-
-import java.nio.charset.StandardCharsets
-
-@Unroll
-class ZooKeeperMigratorTest extends Specification {
-
- def "Test auth and jaas usage simultaneously"() {
- when:
- ZooKeeperMigratorMain.main(['-r', '-z', 'localhost:2181/path', '-a', 'user:pass', '-k', 'jaas.conf'] as String[])
-
- then:
- noExceptionThrown()
- }
-
- def "Receive from open ZooKeeper"() {
- given:
- def server = new TestingServer()
- def client = new ZooKeeper(server.connectString, 3000, { WatchedEvent watchedEvent ->
- })
- def migrationPathRoot = '/nifi/components'
- ZKPaths.mkdirs(client, migrationPathRoot)
- client.setData(migrationPathRoot, 'some data'.bytes, 0)
- def componentName = '1'
- client.create("$migrationPathRoot/$componentName", 'some data'.bytes, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT)
- componentName = '1/a'
- client.create("$migrationPathRoot/$componentName", 'some data'.bytes, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL)
- componentName = '2'
- client.create("$migrationPathRoot/$componentName", 'some data'.bytes, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT)
- componentName = '3'
- client.create("$migrationPathRoot/$componentName", 'some data'.bytes, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT)
- def outputFilePath = 'target/test-data.json'
-
- when:
- ZooKeeperMigratorMain.main(['-r', '-z', "$server.connectString$migrationPathRoot", '-f', outputFilePath] as String[])
-
- then:
- noExceptionThrown()
- def persistedData = new Gson().fromJson(new JsonReader(new FileReader(outputFilePath)), List) as List
- persistedData.size() == 6
- }
-
- def "Send to open ZooKeeper without ACL migration"() {
- given:
- def server = new TestingServer()
- def client = new ZooKeeper(server.connectString, 3000, { WatchedEvent watchedEvent ->
- })
- def migrationPathRoot = '/newParent'
-
- when:
- ZooKeeperMigratorMain.main(['-s', '-z', "$server.connectString$migrationPathRoot", '-f', 'src/test/resources/test-data.json'] as String[])
-
- then:
- noExceptionThrown()
- def nodes = ZKPaths.getSortedChildren(client, '/').collect { ZKUtil.listSubTreeBFS(client, "/$it") }.flatten()
- nodes.size() == 7
- }
-
- def "Send to open ZooKeeper without ACL migration with new multi-node parent"() {
- given:
- def server = new TestingServer()
- def client = new ZooKeeper(server.connectString, 3000, { WatchedEvent watchedEvent ->
- })
- def migrationPathRoot = '/newParent/node'
-
- when:
- ZooKeeperMigratorMain.main(['-s', '-z', "$server.connectString$migrationPathRoot", '-f', 'src/test/resources/test-data.json'] as String[])
-
- then:
- noExceptionThrown()
- def nodes = ZKPaths.getSortedChildren(client, '/').collect { ZKUtil.listSubTreeBFS(client, "/$it") }.flatten()
- nodes.size() == 8
- }
-
- def "Receive all nodes from ZooKeeper root"() {
- given:
- def server = new TestingServer()
- def client = new ZooKeeper(server.connectString, 3000, { WatchedEvent watchedEvent ->
- })
- def migrationPathRoot = '/'
- def addedNodePath = 'nifi'
- client.create("$migrationPathRoot$addedNodePath", 'some data'.bytes, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT)
- def outputFilePath = 'target/test-data-root.json'
-
- when:
- ZooKeeperMigratorMain.main(['-r', '-z', "$server.connectString$migrationPathRoot", '-f', outputFilePath] as String[])
-
- then:
- noExceptionThrown()
- def persistedData = new Gson().fromJson(new JsonReader(new FileReader(outputFilePath)), List) as List
- persistedData.size() == 6
- }
-
- def "Receive Zookeeper node created with username and password"() {
- given:
- def server = new TestingServer()
- def client = new ZooKeeper(server.connectString, 3000, { WatchedEvent watchedEvent ->
- })
- def username = 'nifi'
- def password = 'nifi'
- client.addAuthInfo('digest', "$username:$password".getBytes(StandardCharsets.UTF_8))
- def migrationPathRoot = '/nifi'
- client.create(migrationPathRoot, 'some data'.bytes, ZooDefs.Ids.CREATOR_ALL_ACL, CreateMode.PERSISTENT)
- def outputFilePath = 'target/test-data-user-pass.json'
-
- when:
- ZooKeeperMigratorMain.main(['-r', '-z', "$server.connectString$migrationPathRoot", '-f', outputFilePath, '-a', "$username:$password"] as String[])
-
- then:
- noExceptionThrown()
- def persistedData = new Gson().fromJson(new JsonReader(new FileReader(outputFilePath)), List) as List
- persistedData.size() == 2
- }
-
- def "Send to Zookeeper a node created with username and password"() {
- given:
- def server = new TestingServer()
- def client = new ZooKeeper(server.connectString, 3000, { WatchedEvent watchedEvent ->
- })
- def username = 'nifi'
- def password = 'nifi'
- client.addAuthInfo('digest', "$username:$password".getBytes(StandardCharsets.UTF_8))
- def migrationPathRoot = '/newParent'
-
- when:
- ZooKeeperMigratorMain.main(['-s', '-z', "$server.connectString$migrationPathRoot", '-f', 'src/test/resources/test-data-user-pass.json', '-a', "$username:$password"] as String[])
-
- then:
- noExceptionThrown()
- def nodes = ZKPaths.getSortedChildren(client, '/').collect { ZKUtil.listSubTreeBFS(client, "/$it") }.flatten()
- nodes.size() == 4
- }
-
- def "Send to open Zookeeper with ACL migration"() {
- given:
- def server = new TestingServer()
- def client = new ZooKeeper(server.connectString, 3000, { WatchedEvent watchedEvent ->
- })
- def migrationPathRoot = '/nifi-open'
-
- when:
- ZooKeeperMigratorMain.main(['-s', '-z', "$server.connectString$migrationPathRoot", '-f', 'src/test/resources/test-data-user-pass.json'] as String[])
-
- then:
- noExceptionThrown()
- def nodes = ZKPaths.getSortedChildren(client, '/').collect { ZKUtil.listSubTreeBFS(client, "/$it") }.flatten()
- nodes.size() == 4
- }
-
- def "Send to open Zookeeper using existing ACL"() {
- given:
- def server = new TestingServer()
- def securedClient = new ZooKeeper(server.connectString, 3000, { WatchedEvent watchedEvent -> })
- def userPass = "nifi:nifi"
- securedClient.addAuthInfo("digest",userPass.getBytes(StandardCharsets.UTF_8))
- def digest = DigestAuthenticationProvider.generateDigest(userPass)
- def migrationPathRoot = '/nifi'
- def stat = new Stat()
-
- when:
- ZooKeeperMigratorMain.main(['-s', '-z', "$server.connectString$migrationPathRoot", '-f', 'src/test/resources/test-data-user-pass.json','--use-existing-acl'] as String[])
-
- then:
- noExceptionThrown()
- def acl = securedClient.getACL("/nifi",stat)
- acl.get(0).id.scheme == "digest"
- acl.get(0).id.id == digest
- def nodes = ZKPaths.getSortedChildren(securedClient, '/nifi').collect { ZKUtil.listSubTreeBFS(securedClient, "/$it") }.flatten()
- nodes.size() == 0
- }
-
-
- def "Parse Zookeeper connect string and path"() {
- when:
- def zooKeeperMigrator = new ZooKeeperMigrator("$connectString")
-
- then:
- zooKeeperMigrator.zooKeeperEndpointConfig.connectString == connectString
- zooKeeperMigrator.zooKeeperEndpointConfig.servers == servers.split(',').collect()
- zooKeeperMigrator.zooKeeperEndpointConfig.path == path
-
- where:
- connectString | path | servers || _
- '127.0.0.1' | '/' | '127.0.0.1' || _
- '127.0.0.1,127.0.0.2' | '/' | '127.0.0.1,127.0.0.2' || _
- '127.0.0.1/' | '/' | '127.0.0.1' || _
- '127.0.0.1,127.0.0.2/' | '/' | '127.0.0.1,127.0.0.2' || _
- '127.0.0.1:2181' | '/' | '127.0.0.1:2181' || _
- '127.0.0.1,127.0.0.2:2181' | '/' | '127.0.0.1,127.0.0.2:2181' || _
- '127.0.0.1:2181/' | '/' | '127.0.0.1:2181' || _
- '127.0.0.1,127.0.0.2:2181/' | '/' | '127.0.0.1,127.0.0.2:2181' || _
- '127.0.0.1/path' | '/path' | '127.0.0.1' || _
- '127.0.0.1,127.0.0.2/path' | '/path' | '127.0.0.1,127.0.0.2' || _
- '127.0.0.1/path/node' | '/path/node' | '127.0.0.1' || _
- '127.0.0.1,127.0.0.2/path/node' | '/path/node' | '127.0.0.1,127.0.0.2' || _
- '127.0.0.1:2181/' | '/' | '127.0.0.1:2181' || _
- '127.0.0.1,127.0.0.2:2181/' | '/' | '127.0.0.1,127.0.0.2:2181' || _
- '127.0.0.1:2181/path' | '/path' | '127.0.0.1:2181' || _
- '127.0.0.1,127.0.0.2:2181/path' | '/path' | '127.0.0.1,127.0.0.2:2181' || _
- '127.0.0.1:2181/path/node' | '/path/node' | '127.0.0.1:2181' || _
- '127.0.0.1,127.0.0.2:2181/path/node' | '/path/node' | '127.0.0.1,127.0.0.2:2181' || _
- '127.0.0.1,127.0.0.2:2182,127.0.0.3:2183' | '/' | '127.0.0.1,127.0.0.2:2182,127.0.0.3:2183' || _
- '127.0.0.1,127.0.0.2:2182,127.0.0.3:2183/' | '/' | '127.0.0.1,127.0.0.2:2182,127.0.0.3:2183' || _
- '127.0.0.1,127.0.0.2:2182,127.0.0.3:2183/path' | '/path' | '127.0.0.1,127.0.0.2:2182,127.0.0.3:2183' || _
- '127.0.0.1,127.0.0.2:2182,127.0.0.3:2183/path/node' | '/path/node' | '127.0.0.1,127.0.0.2:2182,127.0.0.3:2183' || _
- }
-
- def "Test ignore source" () {
- given:
- def server = new TestingServer()
- def migrationPathRoot = '/nifi/components'
- def connectString = "$server.connectString"
- def dataPath = 'target/test-data-ignore-source.json'
- def client = new ZooKeeper(server.connectString, 3000, { WatchedEvent watchedEvent ->
- })
-
- // Create some znodes under /nifi/components
- ZKPaths.mkdirs(client, migrationPathRoot)
- client.setData(migrationPathRoot, 'some data'.bytes, 0)
- def componentName = '1'
- client.create("$migrationPathRoot/$componentName", 'some data'.bytes, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT)
- componentName = '1/a'
- client.create("$migrationPathRoot/$componentName", 'some data'.bytes, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL)
- componentName = '2'
- client.create("$migrationPathRoot/$componentName", 'some data'.bytes, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT)
- componentName = '3'
- client.create("$migrationPathRoot/$componentName", 'some data'.bytes, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT)
-
- when: "data is read from the source zookeeper"
- ZooKeeperMigratorMain.main(['-r', '-z', "$connectString$migrationPathRoot", '-f', dataPath] as String[])
-
- then: "verify the data has been written to the output file"
- new File(dataPath).exists()
-
- when: "data is sent to the same zookeeper as the the source zookeeper without ignore source"
- ZooKeeperMigratorMain.main(['-s', '-z', "$connectString$migrationPathRoot", '-f', dataPath] as String[])
-
- then: "verify that an illegal argument exception is thrown"
- thrown(IllegalArgumentException)
-
- when: "data is sent to the same zookeeper as the source zookeeper with ignore source option set"
- ZooKeeperMigratorMain.main(['-s', '-z', "$connectString$migrationPathRoot", '-f', dataPath, '--ignore-source', '--use-existing-acl'] as String[])
-
- then: "no exceptions are thrown"
- noExceptionThrown()
- }
-
- def "Send to same ZooKeeper with different path"() {
- def server = new TestingServer()
- def connectString = "$server.connectString"
- def dataPath = 'target/test-data-different-path.json'
-
- when: "data is read from the source zookeeper"
- ZooKeeperMigratorMain.main(['-r', '-z', connectString, '-f', dataPath] as String[])
-
- then: "verify the data has been written to the output file"
- new File(dataPath).exists()
-
- when: "data is sent to the same zookeeper as the the source zookeeper with a different path"
- ZooKeeperMigratorMain.main(['-s', '-z', "$connectString/new-path", '-f', dataPath] as String[])
-
- then: "no exceptions are thrown"
- noExceptionThrown()
- }
-}
diff --git a/pom.xml b/pom.xml
index fa9be9a577..bde25c3491 100644
--- a/pom.xml
+++ b/pom.xml
@@ -118,7 +118,7 @@
<org.apache.httpcomponents.httpcore.version>4.4.15</org.apache.httpcomponents.httpcore.version>
<org.bouncycastle.version>1.71</org.bouncycastle.version>
<testcontainers.version>1.17.6</testcontainers.version>
- <org.slf4j.version>1.7.36</org.slf4j.version>
+ <org.slf4j.version>2.0.6</org.slf4j.version>
<ranger.version>2.3.0</ranger.version>
<jetty.version>9.4.50.v20221201</jetty.version>
<jackson.bom.version>2.14.1</jackson.bom.version>
@@ -138,7 +138,7 @@
<aspectj.version>1.9.6</aspectj.version>
<jersey.bom.version>2.36</jersey.bom.version>
<log4j2.version>2.18.0</log4j2.version>
- <logback.version>1.2.11</logback.version>
+ <logback.version>1.3.5</logback.version>
<mockito.version>3.12.4</mockito.version>
<netty.3.version>3.10.6.Final</netty.3.version>
<snakeyaml.version>1.33</snakeyaml.version>
@@ -177,6 +177,12 @@
<version>${logback.version}</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-core</artifactId>
+ <version>${logback.version}</version>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>