From d808094e8213e6ed7ca748460195eedc62d566e3 Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Tue, 19 Sep 2017 14:32:34 +1000 Subject: [PATCH 1/2] Issue #1829 --- .../annotations/AnnotationConfiguration.java | 19 +++++++++++++++++++ .../eclipse/jetty/osgi/test/TestOSGiUtil.java | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java index 80935a4693f..4c4aef88441 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java @@ -25,9 +25,11 @@ import java.util.Set; import javax.servlet.ServletContainerInitializer; + import org.eclipse.jetty.annotations.AnnotationParser.Handler; import org.eclipse.jetty.osgi.boot.OSGiWebInfConfiguration; import org.eclipse.jetty.osgi.boot.OSGiWebappConstants; +import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; @@ -184,6 +186,23 @@ public class AnnotationConfiguration extends org.eclipse.jetty.annotations.Annot parseBundle(context,parser,webbundle,webbundle); } + + + + /** + * @see org.eclipse.jetty.annotations.AnnotationConfiguration#parseWebInfClasses(org.eclipse.jetty.webapp.WebAppContext, org.eclipse.jetty.annotations.AnnotationParser) + */ + @Override + public void parseWebInfClasses(WebAppContext context, org.eclipse.jetty.annotations.AnnotationParser parser) + throws Exception + { + Bundle webbundle = (Bundle) context.getAttribute(OSGiWebappConstants.JETTY_OSGI_BUNDLE); + String bundleClasspath = (String)webbundle.getHeaders().get(Constants.BUNDLE_CLASSPATH); + //only scan WEB-INF/classes if we didn't already scan it with parseWebBundle + if (StringUtil.isBlank(bundleClasspath) || !bundleClasspath.contains("WEB-INF/classes")) + super.parseWebInfClasses(context, parser); + } + /** * Scan a bundle required by the webbundle for servlet annotations * @param context The webapp context diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java index bd64e9e6e40..c78488e03f6 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java +++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java @@ -128,7 +128,7 @@ public class TestOSGiUtil for (Bundle b : bundleContext.getBundles()) { bundlesIndexedBySymbolicName.put(b.getSymbolicName(), b); - System.err.println(" " + b.getSymbolicName() + " " + b.getLocation() + " " + b.getVersion()+ " " + b.getState()); + System.err.println(" " + b.getBundleId()+" "+b.getSymbolicName() + " " + b.getLocation() + " " + b.getVersion()+ " " + b.getState()); } } From d3b14b97fbcadd18c9887b8ff26f197eb83938ae Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Tue, 19 Sep 2017 14:38:14 +1000 Subject: [PATCH 2/2] Issue #1760 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d8fc754385b..7e5c1ac9650 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ 1.6.6 1.2 1.1.3.v20160715 - 8.5.9.1 + 8.5.20 undefined