From 363de3503c602ab6a19b5c363ab1fe3c006b31d8 Mon Sep 17 00:00:00 2001 From: Stefan Bischof Date: Tue, 28 Oct 2025 18:01:30 +0100 Subject: [PATCH] rm printStacktrace and switch to slf4 api, dedup maven deps Signed-off-by: Stefan Bischof --- all/pom.xml | 5 +++++ .../eclipse/osgi/technology/command/all/Activator.java | 8 ++++++-- osgi.service.jakartars/pom.xml | 6 ------ util/pom.xml | 5 ----- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/all/pom.xml b/all/pom.xml index 11ccf69..d0d521d 100644 --- a/all/pom.xml +++ b/all/pom.xml @@ -34,6 +34,11 @@ + + + org.slf4j + slf4j-api + org.eclipse.osgi-technology.command converter.bundle diff --git a/all/src/main/java/org/eclipse/osgi/technology/command/all/Activator.java b/all/src/main/java/org/eclipse/osgi/technology/command/all/Activator.java index 8af1112..f23e737 100644 --- a/all/src/main/java/org/eclipse/osgi/technology/command/all/Activator.java +++ b/all/src/main/java/org/eclipse/osgi/technology/command/all/Activator.java @@ -19,12 +19,16 @@ import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.Constants; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @Header(name = Constants.BUNDLE_ACTIVATOR, value = "${@class}") @org.osgi.annotation.bundle.Capability(namespace = "org.apache.felix.gogo", name = "command.implementation", version = "1.0.0") @org.osgi.annotation.bundle.Requirement(effective = "active", namespace = "org.apache.felix.gogo", name = "runtime.implementation", version = "1.0.0") public class Activator implements BundleActivator { + private static final Logger logger = LoggerFactory.getLogger(Activator.class); + private List activators = List.of( new org.eclipse.osgi.technology.command.converter.bundle.Activator(), new org.eclipse.osgi.technology.command.converter.file.Activator(), @@ -47,7 +51,7 @@ public void start(BundleContext context) throws Exception { try { a.start(context); } catch (Exception e) { - e.printStackTrace(); + logger.error("Failed to start activator: {}", a.getClass().getName(), e); } }); @@ -60,7 +64,7 @@ public void stop(BundleContext context) throws Exception { try { a.stop(context); } catch (Exception e) { - e.printStackTrace(); + logger.error("Failed to stop activator: {}", a.getClass().getName(), e); } }); diff --git a/osgi.service.jakartars/pom.xml b/osgi.service.jakartars/pom.xml index fcf400e..c89b6bc 100644 --- a/osgi.service.jakartars/pom.xml +++ b/osgi.service.jakartars/pom.xml @@ -64,12 +64,6 @@ jakarta.json-api 2.1.3 - - org.eclipse.osgi-technology.rest - org.eclipse.osgitech.rest.jetty - 1.2.3 - test - org.osgi org.osgi.util.tracker diff --git a/util/pom.xml b/util/pom.xml index 43fff8d..dde44c4 100644 --- a/util/pom.xml +++ b/util/pom.xml @@ -97,11 +97,6 @@ 1.1.2 - - org.osgi - org.osgi.framework - - org.osgi org.osgi.service.component.annotations