Merging conflicts with master
diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 0000000..f582519
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,20 @@
+/**
+ * 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.
+ */
+
+slingOsgiBundleBuild()
diff --git a/pom.xml b/pom.xml
index 8c2caa3..bab110f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@
This version is a concatenation of the framework version and a version for the launchpad base itself.
For a release only the qualifier (launchpad base version) is increased.
-->
- <version>6.0.1-2.6.33-SNAPSHOT</version>
+ <version>6.0.2-2.6.37-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>Apache Sling Launchpad Base</name>
@@ -234,7 +234,7 @@
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.framework</artifactId>
- <version>6.0.1</version>
+ <version>6.0.2</version>
<scope>provided</scope>
</dependency>
<dependency>
diff --git a/src/main/java/org/apache/sling/launchpad/base/webapp/SlingServletDelegate.java b/src/main/java/org/apache/sling/launchpad/base/webapp/SlingServletDelegate.java
index 818c514..4fe6f4b 100644
--- a/src/main/java/org/apache/sling/launchpad/base/webapp/SlingServletDelegate.java
+++ b/src/main/java/org/apache/sling/launchpad/base/webapp/SlingServletDelegate.java
@@ -320,6 +320,20 @@
// ---------- Configuration Loading ----------------------------------------
+ private String calculateServletPackages(final String servletVersion, final int majorVersion) {
+ final String servlet2Packages = "javax.servlet;javax.servlet.http;javax.servlet.resources";
+ final String servlet3Packages = servlet2Packages + ";javax.servlet.annotation;javax.servlet.descriptor";
+ if (majorVersion < 3) {
+ return servlet2Packages.concat(";version=").concat(servletVersion);
+ } else if (majorVersion < 4) {
+ return servlet2Packages.concat(";version=2.6,").concat(servlet3Packages).concat(";version=")
+ .concat(servletVersion);
+ }
+ return servlet2Packages.concat(";version=2.6,").concat(servlet3Packages).concat(";version=3.1,")
+ .concat(servlet3Packages).concat(";version=").concat(servletVersion);
+
+ }
+
/**
* Loads the configuration properties in the configuration property file
* associated with the framework installation; these properties are
@@ -343,17 +357,12 @@
// Try to load it from one of these places.
Map<String, String> props = new HashMap<String, String>();
- // The following property must start with a comma!
final String servletVersion = getServletContext().getMajorVersion() + "." +
getServletContext().getMinorVersion();
- String packages = ",javax.servlet;javax.servlet.http;javax.servlet.resources";
- if ( getServletContext().getMajorVersion() >= 3 ) {
- // servlet 3.x adds new packages and we should export as 2.6 and 3.x
- packages = packages + "; version=2.6" + packages + ";javax.servlet.annotation;javax.servlet.descriptor";
- }
+ // This property must start with a comma!
props.put(
Sling.PROP_SYSTEM_PACKAGES,
- packages + "; version=" + servletVersion);
+ ",".concat(calculateServletPackages(servletVersion, getServletContext().getMajorVersion())));
// extra capabilities
final String servletCaps = "osgi.contract;osgi.contract=JavaServlet;version:Version=\" " + servletVersion + "\";" +
"uses:=\"javax.servlet,javax.servlet.http,javax.servlet.descriptor,javax.servlet.annotation\"";