From fe416622026b9d2e0ddcaf8a17da49f9d3ede97f Mon Sep 17 00:00:00 2001 From: Hannes Wellmann Date: Mon, 28 Aug 2023 21:26:28 +0200 Subject: [PATCH] Unconfigure slf4j.simple when m2e.logback.feature is installed Disable slf4j.simple when present during the installation of the m2e.logback feature. This prevents warnings about multiple slf4j providers found in the runtime and the potential to have slf4j.simple being selected as provider in use. --- org.eclipse.m2e.logback.feature/p2.inf | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/org.eclipse.m2e.logback.feature/p2.inf b/org.eclipse.m2e.logback.feature/p2.inf index 0280a43ebe..fc9ea2f76f 100644 --- a/org.eclipse.m2e.logback.feature/p2.inf +++ b/org.eclipse.m2e.logback.feature/p2.inf @@ -4,6 +4,11 @@ requires.0.namespace=org.eclipse.equinox.p2.iu requires.0.name=configure.logback.classic requires.0.range=[$version$,$version$] requires.0.greedy=true +requires.1.namespace=org.eclipse.equinox.p2.iu +requires.1.name=unconfigure.slf4j.simple +requires.1.range=[$version$,$version$] +requires.1.greedy=true +requires.1.optional=true #Create a IU fragment named configure.logback.classic units.0.id=configure.logback.classic @@ -23,3 +28,22 @@ units.0.hostRequirements.0.namespace=osgi.bundle units.0.hostRequirements.0.name=ch.qos.logback.classic units.0.hostRequirements.0.range=[1.3,1.6) units.0.hostRequirements.0.greedy=false + +#Create a IU fragment named unconfigure.slf4j.simple +units.1.id=unconfigure.slf4j.simple +units.1.version=$version$ +units.1.provides.0.namespace=org.eclipse.equinox.p2.iu +units.1.provides.0.name=unconfigure.slf4j.simple +units.1.provides.0.version=$version$ +units.1.instructions.install=org.eclipse.equinox.p2.touchpoint.eclipse.installBundle(bundle:${artifact}); +units.1.instructions.uninstall=org.eclipse.equinox.p2.touchpoint.eclipse.uninstallBundle(bundle:${artifact}); +units.1.instructions.configure= \ + org.eclipse.equinox.p2.touchpoint.eclipse.setStartLevel(startLevel:-1); \ + org.eclipse.equinox.p2.touchpoint.eclipse.markStarted(started:false); +units.1.instructions.unconfigure= \ + org.eclipse.equinox.p2.touchpoint.eclipse.setStartLevel(startLevel:2); \ + org.eclipse.equinox.p2.touchpoint.eclipse.markStarted(started:true); +units.1.hostRequirements.0.namespace=osgi.bundle +units.1.hostRequirements.0.name=slf4j.simple +units.1.hostRequirements.0.range=[2.0,3.0) +units.1.hostRequirements.0.greedy=false