Repository: camunda/camunda
Pull request #30555: deps: remove commons logging
Author: login: jonathanlukas
Labels: name: component/zeebe
description: Related to the Zeebe component/team
name: backport stable/8.7
description: Backport a pull request to stable/8.7
name: version:8.7.1
Created: 2025-04-03T09:05:10Z | Merged: 2025-04-03T11:47:09Z

## Description

<!-- Describe the goal and purpose of this PR. -->

This PR removes the previously added commons-logging dependecy requirement

follow up to #30474 

## Checklist

<!--- Please delete options that are not relevant. Boxes should be checked by reviewer. -->
- [ ] for CI changes:
  - [ ] structural/foundational changes signed off by [CI DRI](https://github.com/cmur2)
  - [ ] [ci.yml](https://github.com/camunda/camunda/blob/main/.github/workflows/ci.yml) modifications comply with ["Unified CI" requirements](https://github.com/camunda/camunda/wiki/CI-&-Automation#workflow-inclusion-criteria)
  - [ ] enable backports [when recommended](https://github.com/camunda/camunda/wiki/CI-&-Automation#when-to-backport-ci-changes)

## Related issues

closes #



Diff:
diff --git a/clients/spring-boot-starter-camunda-sdk/pom.xml b/clients/spring-boot-starter-camunda-sdk/pom.xml
index 047ddaec588f..c1a28f0fd7f8 100644
--- a/clients/spring-boot-starter-camunda-sdk/pom.xml
+++ b/clients/spring-boot-starter-camunda-sdk/pom.xml
@@ -132,16 +132,6 @@
       <scope>provided</scope>
     </dependency>
 
-    <dependency>
-      <groupId>org.springframework</groupId>
-      <artifactId>spring-jcl</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>commons-logging</groupId>
-      <artifactId>commons-logging</artifactId>
-    </dependency>
-
     <dependency>
       <groupId>org.junit.platform</groupId>
       <artifactId>junit-platform-commons</artifactId>
@@ -183,11 +173,6 @@
       <artifactId>junit-jupiter-api</artifactId>
       <scope>test</scope>
     </dependency>
-    <dependency>
-      <groupId>ch.qos.logback</groupId>
-      <artifactId>logback-classic</artifactId>
-      <scope>test</scope>
-    </dependency>
   </dependencies>
 
   <build>
@@ -200,9 +185,11 @@
           <usedDependencies>
             <dependency>org.springframework.boot:spring-boot-configuration-processor</dependency>
             <dependency>commons-collections:commons-collections</dependency>
-            <dependency>ch.qos.logback:logback-classic</dependency>
-            <dependency>commons-logging:commons-logging</dependency>
           </usedDependencies>
+          <ignoredUsedUndeclaredDependencies>
+            <dependency>commons-logging:commons-logging</dependency>
+            <dependency>org.springframework:spring-jcl</dependency>
+          </ignoredUsedUndeclaredDependencies>
         </configuration>
       </plugin>
 
diff --git a/clients/spring-boot-starter-camunda-sdk/src/main/java/io/camunda/spring/client/properties/CamundaClientPropertiesPostProcessor.java b/clients/spring-boot-starter-camunda-sdk/src/main/java/io/camunda/spring/client/properties/CamundaClientPropertiesPostProcessor.java
index d3a94ad70ff3..a15289c7b340 100644
--- a/clients/spring-boot-starter-camunda-sdk/src/main/java/io/camunda/spring/client/properties/CamundaClientPropertiesPostProcessor.java
+++ b/clients/spring-boot-starter-camunda-sdk/src/main/java/io/camunda/spring/client/properties/CamundaClientPropertiesPostProcessor.java
@@ -20,10 +20,10 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import org.apache.commons.logging.Log;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.env.EnvironmentPostProcessor;
 import org.springframework.boot.env.YamlPropertySourceLoader;
+import org.springframework.boot.logging.DeferredLog;
 import org.springframework.boot.logging.DeferredLogFactory;
 import org.springframework.core.env.ConfigurableEnvironment;
 import org.springframework.core.env.EnumerablePropertySource;
@@ -35,10 +35,10 @@ public class CamundaClientPropertiesPostProcessor implements EnvironmentPostProc
   private static final String OVERRIDE_PREFIX = "camunda.client.worker.override.";
   private static final List<String> LEGACY_OVERRIDE_PREFIX =
       List.of("camunda.client.zeebe.override.", "zeebe.client.worker.override.");
-  private final Log log;
+  private final DeferredLog log;
 
   public CamundaClientPropertiesPostProcessor(final DeferredLogFactory deferredLogFactory) {
-    log = deferredLogFactory.getLog(getClass());
+    log = (DeferredLog) deferredLogFactory.getLog(getClass());
   }
 
   @Override
diff --git a/clients/spring-boot-starter-camunda-sdk/src/test/java/io/camunda/spring/client/properties/PropertiesPostProcessorLoggingTest.java b/clients/spring-boot-starter-camunda-sdk/src/test/java/io/camunda/spring/client/properties/PropertiesPostProcessorLoggingTest.java
new file mode 100644
index 000000000000..dacdad3acb4a
--- /dev/null
+++ b/clients/spring-boot-starter-camunda-sdk/src/test/java/io/camunda/spring/client/properties/PropertiesPostProcessorLoggingTest.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright © 2017 camunda services GmbH (info@camunda.com)
+ *
+ * Licensed 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 io.camunda.spring.client.properties;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.test.system.CapturedOutput;
+import org.springframework.boot.test.system.OutputCaptureExtension;
+
+@SpringBootTest(
+    properties = "zeebe.client.broker.grpc-address=http://legacy:26500",
+    classes = CamundaClientPropertiesTestConfig.class)
+@ExtendWith(OutputCaptureExtension.class)
+public class PropertiesPostProcessorLoggingTest {
+  @Test
+  void shouldLogPropertyMapping(final CapturedOutput output) {
+    assertThat(output)
+        .contains(
+            "Legacy property 'zeebe.client.broker.grpc-address' found, setting to 'camunda.client.grpc-address'. Please update your setup to use the latest property");
+  }
+}


Reviews:
user: login: tmetzke
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-04-03T09:32:45Z
user: login: tmetzke
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-04-03T09:33:52Z
user: login: tmetzke
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-04-03T09:34:29Z
user: login: jonathanlukas
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-03T09:35:46Z
user: login: jonathanlukas
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-03T09:36:08Z
user: login: tmetzke
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-04-03T09:56:07Z
user: login: tmetzke
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-04-03T09:56:47Z
user: login: jonathanlukas
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-03T09:58:43Z
user: login: jonathanlukas
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-03T09:59:06Z
user: login: jonathanlukas
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-03T10:30:56Z
user: login: tmetzke
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-04-03T11:03:04Z
user: login: tmetzke
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-04-03T11:09:49Z
user: login: tmetzke
body: Thanks for the quick reaction time and open conversation here, @jonathanlukas, super helpful 🫶 
state: APPROVED
author_association: MEMBER
submitted_at: 2025-04-03T11:12:01Z

Review comments:
diff_hunk: @@ -201,7 +186,6 @@
             <dependency>org.springframework.boot:spring-boot-configuration-processor</dependency>
             <dependency>commons-collections:commons-collections</dependency>
             <dependency>ch.qos.logback:logback-classic</dependency>
path: clients/spring-boot-starter-camunda-sdk/pom.xml
user: login: tmetzke
body: 🔧 I think we don't need this anymore since you removed the logback dependency.
created_at: 2025-04-03T09:32:45Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,39 @@
+/*
+ * Copyright © 2017 camunda services GmbH (info@camunda.com)
+ *
+ * Licensed 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 io.camunda.spring.client.properties;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.junit.jupiter.api.Nested;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.test.system.CapturedOutput;
+import org.springframework.boot.test.system.OutputCaptureExtension;
+
+@SpringBootTest(
+    properties = "zeebe.client.broker.grpc-address=http://legacy:26500",
+    classes = CamundaClientPropertiesTestConfig.class)
+@Nested
path: clients/spring-boot-starter-camunda-sdk/src/test/java/io/camunda/spring/client/properties/PropertiesPostProcessorLoggingTest.java
user: login: tmetzke
body: ❓ Excuse my limited Spring-magic knowledge: why do we need the `Nested` here?
created_at: 2025-04-03T09:33:51Z
author_association: MEMBER
diff_hunk: @@ -201,7 +186,6 @@
             <dependency>org.springframework.boot:spring-boot-configuration-processor</dependency>
             <dependency>commons-collections:commons-collections</dependency>
             <dependency>ch.qos.logback:logback-classic</dependency>
path: clients/spring-boot-starter-camunda-sdk/pom.xml
user: login: tmetzke
body: ```suggestion
```
created_at: 2025-04-03T09:34:29Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,39 @@
+/*
+ * Copyright © 2017 camunda services GmbH (info@camunda.com)
+ *
+ * Licensed 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 io.camunda.spring.client.properties;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.junit.jupiter.api.Nested;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.test.system.CapturedOutput;
+import org.springframework.boot.test.system.OutputCaptureExtension;
+
+@SpringBootTest(
+    properties = "zeebe.client.broker.grpc-address=http://legacy:26500",
+    classes = CamundaClientPropertiesTestConfig.class)
+@Nested
path: clients/spring-boot-starter-camunda-sdk/src/test/java/io/camunda/spring/client/properties/PropertiesPostProcessorLoggingTest.java
user: login: jonathanlukas
body: Copy paste problem... can be removed.
created_at: 2025-04-03T09:35:45Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,39 @@
+/*
+ * Copyright © 2017 camunda services GmbH (info@camunda.com)
+ *
+ * Licensed 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 io.camunda.spring.client.properties;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.junit.jupiter.api.Nested;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.test.system.CapturedOutput;
+import org.springframework.boot.test.system.OutputCaptureExtension;
+
+@SpringBootTest(
+    properties = "zeebe.client.broker.grpc-address=http://legacy:26500",
+    classes = CamundaClientPropertiesTestConfig.class)
+@Nested
path: clients/spring-boot-starter-camunda-sdk/src/test/java/io/camunda/spring/client/properties/PropertiesPostProcessorLoggingTest.java
user: login: jonathanlukas
body: ```suggestion
```
created_at: 2025-04-03T09:36:07Z
author_association: CONTRIBUTOR
diff_hunk: @@ -132,16 +132,6 @@
       <scope>provided</scope>
     </dependency>
 
-    <dependency>
-      <groupId>org.springframework</groupId>
-      <artifactId>spring-jcl</artifactId>
-    </dependency>
path: clients/spring-boot-starter-camunda-sdk/pom.xml
user: login: tmetzke
body: 🔧 This is still needed since we use `DeferredLog`, I think.
created_at: 2025-04-03T09:56:07Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,38 @@
+/*
+ * Copyright © 2017 camunda services GmbH (info@camunda.com)
+ *
+ * Licensed 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 io.camunda.spring.client.properties;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.junit.jupiter.api.Nested;
path: clients/spring-boot-starter-camunda-sdk/src/test/java/io/camunda/spring/client/properties/PropertiesPostProcessorLoggingTest.java
user: login: tmetzke
body: 🔧 This needs to go
```suggestion
```
created_at: 2025-04-03T09:56:47Z
author_association: MEMBER
diff_hunk: @@ -132,16 +132,6 @@
       <scope>provided</scope>
     </dependency>
 
-    <dependency>
-      <groupId>org.springframework</groupId>
-      <artifactId>spring-jcl</artifactId>
-    </dependency>
path: clients/spring-boot-starter-camunda-sdk/pom.xml
user: login: jonathanlukas
body: Nope, I could savely remove it.

In fact, jcl is a "clone" of the apache commons logging.
created_at: 2025-04-03T09:58:43Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,38 @@
+/*
+ * Copyright © 2017 camunda services GmbH (info@camunda.com)
+ *
+ * Licensed 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 io.camunda.spring.client.properties;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.junit.jupiter.api.Nested;
path: clients/spring-boot-starter-camunda-sdk/src/test/java/io/camunda/spring/client/properties/PropertiesPostProcessorLoggingTest.java
user: login: jonathanlukas
body: Done
created_at: 2025-04-03T09:59:06Z
author_association: CONTRIBUTOR
diff_hunk: @@ -132,16 +132,6 @@
       <scope>provided</scope>
     </dependency>
 
-    <dependency>
-      <groupId>org.springframework</groupId>
-      <artifactId>spring-jcl</artifactId>
-    </dependency>
path: clients/spring-boot-starter-camunda-sdk/pom.xml
user: login: jonathanlukas
body: Ok you were right. I wonder why this did not fail locally..
created_at: 2025-04-03T10:30:55Z
author_association: CONTRIBUTOR
diff_hunk: @@ -132,16 +132,6 @@
       <scope>provided</scope>
     </dependency>
 
-    <dependency>
-      <groupId>org.springframework</groupId>
-      <artifactId>spring-jcl</artifactId>
-    </dependency>
path: clients/spring-boot-starter-camunda-sdk/pom.xml
user: login: tmetzke
body: Spring JCL might come as a transitive dependency already, so you can locally use the classes without the explicit dependency. However, if the `DeferredLogger` class is from that lib, our tooling notices this and complains that you should add it explicitly.

But the [latest failure](https://github.com/camunda/camunda/actions/runs/14240819854/job/39910128152) I actually don't understand either:

You added the JCL lib and the tool complained that it's not used, right? It somehow detected that you're using a `commons-logging` class directly and didn't add this dependency? 🤔 
created_at: 2025-04-03T11:03:03Z
author_association: MEMBER
diff_hunk: @@ -132,16 +132,6 @@
       <scope>provided</scope>
     </dependency>
 
-    <dependency>
-      <groupId>org.springframework</groupId>
-      <artifactId>spring-jcl</artifactId>
-    </dependency>
path: clients/spring-boot-starter-camunda-sdk/pom.xml
user: login: tmetzke
body: Spring JCL generally is super weird, I have to admit, looking into some of the issues related to it in the Spring repository 😅 
created_at: 2025-04-03T11:09:49Z
author_association: MEMBER

PR comments:
user: login: tmetzke
created_at: 2025-04-03T09:09:40Z
body: Thanks, @jonathanlukas. Can we test if this still works as expected somehow? Did you check manually?
author_association: MEMBER
user: login: jonathanlukas
created_at: 2025-04-03T09:11:48Z
body: The post processor is executed on each @SpringBootTest. If it would not, we would notice.

I have to admit that I am not sure how we could test whether the cast would work.
author_association: CONTRIBUTOR
user: login: tmetzke
created_at: 2025-04-03T09:13:16Z
body: So, we can have a test that checks the expected log output is there for the cases where we expect the log to appear?
author_association: MEMBER
user: login: jonathanlukas
created_at: 2025-04-03T09:14:25Z
body: This is possible I guess. I already know the perfect place.
author_association: CONTRIBUTOR
user: login: tmetzke
created_at: 2025-04-03T09:14:26Z
body: That test should fail if we don't use deferred logging at all, right?
author_association: MEMBER
user: login: jonathanlukas
created_at: 2025-04-03T09:25:08Z
body: Yes. If we don't use deferred logs, nothing will be logged at all. I did not notice this earlier.
Only when I used the 8.7.0 release, I missed the property mapping log output.

Now, there is a test in place that asserts that a deprecated property is mapped and this is logged.
author_association: CONTRIBUTOR
user: login: backport-action
created_at: 2025-04-03T11:47:42Z
body: Created backport PR for `stable/8.7`:
- #30571 with remaining conflicts!

Please cherry-pick the changes locally and resolve any conflicts.
```bash
git fetch origin backport-30555-to-stable/8.7
git worktree add --checkout .worktree/backport-30555-to-stable/8.7 backport-30555-to-stable/8.7
cd .worktree/backport-30555-to-stable/8.7
git reset --hard HEAD^
git cherry-pick -x 695d0f220b24b38dbeedad49f26a46761de068c2 116d081ce3ff3a18dfe4d4bf633faf57d9e3ea27 55c9a16f65be6f462c686adfd5b13d596d12d48d 389aa9ed93c0ba475e9df9409c9d34cf97e60280 3c6cb7275e9556bd4bc2d952f32e0a52b6f31de2 fd87cb1a7d72fcd2da2ef027922d3b36e73e5c42 26334a91a44a884c8e54830d3f2a7de1e2bb99fc 4171a447a45b2cded748b804b690d7d0f64f7365
git push --force-with-lease
```
author_association: COLLABORATOR