You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2020/02/05 22:25:13 UTC

[sling-org-apache-sling-dynamic-include] branch master updated (1c02ed5 -> 2681332)

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-dynamic-include.git.


    from 1c02ed5  SLING-8427: add Forward filter scope to CacheControlFilter.
     new 7fb2bce  SLING-8982 - dynamic-include: upgrade to parent pom 35
     new 56028e7  SLING-8982 - dynamic-include: upgrade to parent pom 35
     new 2681332  SLING-8987 - Review exported packages

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 pom.xml                                            |  52 +++----
 .../sling/dynamicinclude/CacheControlFilter.java   |  14 +-
 .../apache/sling/dynamicinclude/Configuration.java | 160 +++++++++------------
 .../dynamicinclude/ConfigurationWhiteboard.java    |  31 ++--
 .../sling/dynamicinclude/IncludeTagFilter.java     |  11 +-
 .../dynamicinclude/SyntheticResourceFilter.java    |  21 ++-
 .../generator/IncludeGeneratorWhiteboard.java      |  25 ++--
 .../dynamicinclude/generator/package-info.java     |  22 ---
 .../generator/types/EsiGenerator.java              |   4 +-
 .../generator/types/JsiGenerator.java              |   6 +-
 .../generator/types/SsiGenerator.java              |   4 +-
 .../generator/types/package-info.java              |  22 ---
 .../apache/sling/dynamicinclude/package-info.java  |  22 ---
 .../dynamicinclude/pathmatcher/package-info.java   |  22 ---
 .../sling/dynamicinclude/ConfigurationTest.java    |  44 +++---
 .../ConfigurationWhiteboardTest.java               |  35 ++---
 16 files changed, 184 insertions(+), 311 deletions(-)
 delete mode 100644 src/main/java/org/apache/sling/dynamicinclude/generator/package-info.java
 delete mode 100644 src/main/java/org/apache/sling/dynamicinclude/generator/types/package-info.java
 delete mode 100644 src/main/java/org/apache/sling/dynamicinclude/package-info.java
 delete mode 100644 src/main/java/org/apache/sling/dynamicinclude/pathmatcher/package-info.java


[sling-org-apache-sling-dynamic-include] 01/03: SLING-8982 - dynamic-include: upgrade to parent pom 35

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-dynamic-include.git

commit 7fb2bce95463c71e130a3bac0631f9333867c737
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Fri Jan 10 13:26:46 2020 +0100

    SLING-8982 - dynamic-include: upgrade to parent pom 35
---
 pom.xml                                            |  54 +++----
 .../sling/dynamicinclude/CacheControlFilter.java   |  14 +-
 .../apache/sling/dynamicinclude/Configuration.java | 160 +++++++++------------
 .../dynamicinclude/ConfigurationWhiteboard.java    |  31 ++--
 .../sling/dynamicinclude/IncludeTagFilter.java     |  11 +-
 .../dynamicinclude/SyntheticResourceFilter.java    |  21 ++-
 .../generator/IncludeGeneratorWhiteboard.java      |  25 ++--
 .../dynamicinclude/generator/package-info.java     |   3 +-
 .../generator/types/EsiGenerator.java              |   4 +-
 .../generator/types/JsiGenerator.java              |   6 +-
 .../generator/types/SsiGenerator.java              |   4 +-
 .../generator/types/package-info.java              |   3 +-
 .../apache/sling/dynamicinclude/package-info.java  |   3 +-
 .../dynamicinclude/pathmatcher/package-info.java   |   3 +-
 .../sling/dynamicinclude/ConfigurationTest.java    |  44 +++---
 .../ConfigurationWhiteboardTest.java               |  35 ++---
 16 files changed, 191 insertions(+), 230 deletions(-)

diff --git a/pom.xml b/pom.xml
index f846266..244c94a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,14 +23,13 @@
     
     <parent>
         <groupId>org.apache.sling</groupId>
-        <artifactId>sling</artifactId>
-        <version>26</version>
+        <artifactId>sling-bundle-parent</artifactId>
+        <version>35</version>
         <relativePath />
     </parent>    
     
     <artifactId>org.apache.sling.dynamic-include</artifactId>
     <version>3.1.7-SNAPSHOT</version>
-    <packaging>bundle</packaging>
     
     <name>Apache Sling Dynamic Include</name>
     <description>Dynamic Include filter for Apache Sling</description>
@@ -55,50 +54,36 @@
         </developer>
     </developers>
 
-    <build>
-        <plugins>
-           <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>generate-scr-scrdescriptor</id>
-                        <goals>
-                            <goal>scr</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>        
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <extensions>true</extensions>
-            </plugin>
-        </plugins>
-    </build>
-
     <dependencies>
         <!-- osgi -->
         <dependency>
             <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.core</artifactId>
+            <artifactId>osgi.core</artifactId>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.compendium</artifactId>
+            <artifactId>osgi.cmpn</artifactId>
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.scr.annotations</artifactId>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.annotation.versioning</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.service.component.annotations</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.servlets.annotations</artifactId>
             <scope>provided</scope>
         </dependency>
 
         <!-- javax -->
         <dependency>
             <groupId>javax.servlet</groupId>
-            <artifactId>servlet-api</artifactId>
+            <artifactId>javax.servlet-api</artifactId>
             <scope>provided</scope>
         </dependency>
 
@@ -126,7 +111,6 @@
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
-            <version>1.7.0</version>
             <scope>provided</scope>
         </dependency>
 
@@ -138,10 +122,10 @@
             <scope>provided</scope>
         </dependency>
 
+        <!-- testing -->
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
-            <version>4.12</version>
             <scope>test</scope>
         </dependency>
         <dependency>
@@ -150,6 +134,12 @@
             <version>2.18.3</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.testing.osgi-mock.junit4</artifactId>
+            <version>2.4.10</version>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
 </project>
diff --git a/src/main/java/org/apache/sling/dynamicinclude/CacheControlFilter.java b/src/main/java/org/apache/sling/dynamicinclude/CacheControlFilter.java
index c515815..3591b3f 100644
--- a/src/main/java/org/apache/sling/dynamicinclude/CacheControlFilter.java
+++ b/src/main/java/org/apache/sling/dynamicinclude/CacheControlFilter.java
@@ -28,15 +28,21 @@ import javax.servlet.ServletException;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.sling.SlingFilter;
-import org.apache.felix.scr.annotations.sling.SlingFilterScope;
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.SlingHttpServletResponse;
+import org.apache.sling.servlets.annotations.SlingServletFilter;
+import org.apache.sling.servlets.annotations.SlingServletFilterScope;
+import org.osgi.framework.Constants;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-@SlingFilter(scope = {SlingFilterScope.REQUEST, SlingFilterScope.FORWARD}, order = 0)
+
+@SlingServletFilter(scope = { SlingServletFilterScope.REQUEST, SlingServletFilterScope.FORWARD } )
+@Component(property = { 
+    Constants.SERVICE_RANKING + ":Integer=0"
+})
 public class CacheControlFilter implements Filter {
 
     private static final String HEADER_DATE = "Date";
diff --git a/src/main/java/org/apache/sling/dynamicinclude/Configuration.java b/src/main/java/org/apache/sling/dynamicinclude/Configuration.java
index 51f3823..97a33a1 100755
--- a/src/main/java/org/apache/sling/dynamicinclude/Configuration.java
+++ b/src/main/java/org/apache/sling/dynamicinclude/Configuration.java
@@ -21,101 +21,83 @@ package org.apache.sling.dynamicinclude;
 
 import java.util.Arrays;
 import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
 
 import org.apache.commons.lang3.ArrayUtils;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.ConfigurationPolicy;
-import org.apache.felix.scr.annotations.Properties;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.PropertyOption;
-import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.commons.osgi.PropertiesUtil;
 import org.apache.sling.dynamicinclude.pathmatcher.PathMatcher;
 import org.apache.sling.dynamicinclude.pathmatcher.PrefixPathMatcher;
 import org.apache.sling.dynamicinclude.pathmatcher.RegexPathMatcher;
 import org.osgi.framework.Constants;
-import org.osgi.service.component.ComponentContext;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.ConfigurationPolicy;
+import org.osgi.service.metatype.annotations.AttributeDefinition;
+import org.osgi.service.metatype.annotations.Designate;
+import org.osgi.service.metatype.annotations.ObjectClassDefinition;
+import org.osgi.service.metatype.annotations.Option;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
  * Include filter configuration.
  */
-@Component(metatype = true, configurationFactory = true, label = "Apache Sling Dynamic Include - Configuration", immediate = true, policy = ConfigurationPolicy.REQUIRE)
-@Service(Configuration.class)
-@Properties({
-    @Property(name = Constants.SERVICE_VENDOR, value = "The Apache Software Foundation"),
-    @Property(name = Configuration.PROPERTY_FILTER_ENABLED, boolValue = Configuration.DEFAULT_FILTER_ENABLED, label = "Enabled", description = "Check to enable the filter"),
-    @Property(name = Configuration.PROPERTY_FILTER_PATH, value = Configuration.DEFAULT_FILTER_PATH, label = "Base path regular expression", description = "This SDI configuration will work only for paths matching this value. If value starts with \"^\" sign, regex matching will be performed. Otherwise it will check for path prefix."),
-    @Property(name = Configuration.PROPERTY_FILTER_RESOURCE_TYPES, cardinality = Integer.MAX_VALUE, label = "Resource types", description = "Filter will replace components with selected resource types"),
-    @Property(name = Configuration.PROPERTY_INCLUDE_TYPE, value = Configuration.DEFAULT_INCLUDE_TYPE, label = "Include type", description = "Type of generated include tags", options = {
-        @PropertyOption(name = "SSI", value = "Apache SSI"), @PropertyOption(name = "ESI", value = "ESI"),
-        @PropertyOption(name = "JSI", value = "Javascript")}),
-    @Property(name = Configuration.PROPERTY_ADD_COMMENT, boolValue = Configuration.DEFAULT_ADD_COMMENT, label = "Add comment", description = "Add comment to included components"),
-    @Property(name = Configuration.PROPERTY_FILTER_SELECTOR, value = Configuration.DEFAULT_FILTER_SELECTOR, label = "Filter selector", description = "Selector used to mark included resources"),
-    @Property(name = Configuration.PROPERTY_EXTENSION, value = Configuration.DEFAULT_EXTENSION, label = "Extension", description = "Extension to append to virtual resources to make caching possible"),
-    @Property(name = Configuration.PROPERTY_COMPONENT_TTL, label = "Component TTL", description = "\"Time to live\" cache header for rendered component (in seconds)"),
-    @Property(name = Configuration.PROPERTY_REQUIRED_HEADER, value = Configuration.DEFAULT_REQUIRED_HEADER, label = "Required header", description = "SDI will work only for requests with given header"),
-    @Property(name = Configuration.PROPERTY_IGNORE_URL_PARAMS, cardinality = Integer.MAX_VALUE, label = "Ignore URL params", description = "SDI will process the request even if it contains configured GET parameters"),
-    @Property(name = Configuration.PROPERTY_REWRITE_PATH, boolValue = Configuration.DEFAULT_REWRITE_DISABLED, label = "Include path rewriting", description = "Check to enable include path rewriting"),
-    @Property(name = Configuration.PROPERTY_APPEND_SUFFIX, boolValue = Configuration.DEFAULT_APPEND_SUFFIX, label = "Append suffix to dynamic includes", description = "Check to append the suffix of the parent request to the dynamic include."),
-    @Property(name= Configuration.NAME_HINT_PROPERTY_NAME, value=Configuration.NAME_HINT_VALUE)})
+@Component(service = Configuration.class,
+    immediate = true,
+    configurationPolicy = ConfigurationPolicy.REQUIRE,
+    property = {
+        Constants.SERVICE_VENDOR + "=The Apache Software Foundation",
+        "webconsole.configurationFactory.nameHint={include-filter.config.include-type} for [{include-filter.config.resource-types}] at path: {include-filter.config.path}"
+    })
+@Designate(ocd = Configuration.Config.class, factory = true)
 public class Configuration {
+    
+  @ObjectClassDefinition(name = "Apache Sling Dynamic Include - Configuration")
+  public @interface Config {
+      @AttributeDefinition(name="Enabled", description="Check to enable the filter")
+      boolean include$_$filter_config_enabled() default false;
+      
+      @AttributeDefinition(name="Base path regular expression", description="This SDI configuration will work only for paths matching this value. If value starts with \\\"^\\\" sign, regex matching will be performed. Otherwise it will check for path prefix.")
+      String include$_$filter_config_path() default "/content";
+      
+      @AttributeDefinition(name="Resource types", description="Filter will replace components with selected resource types", cardinality = Integer.MAX_VALUE)
+      String include$_$filter_config_resource$_$types() default "";
+      
+      @AttributeDefinition(name = "Include type", description = "Type of generated include tags", options = {
+          @Option(label = "Apache SSI", value = "SSI"),
+          @Option(label = "ESI", value = "ESI"),
+          @Option(label = "Javascript", value = "JSI")
+      })
+      String include$_$filter_config_include$_$type() default "SSI";
+      
+      @AttributeDefinition(name="Add comment", description = "Add comment to included components")
+      boolean include$_$filter_config_add__comment() default false;
+      
+      @AttributeDefinition(name = "Filter selector", description = "Selector used to mark included resources")
+      String include$_$filter_config_selector() default "nocache";
+
+      @AttributeDefinition(name = "Extension", description = "Extension to append to virtual resources to make caching possible")
+      String include$_$filter_config_extension() default "";
+
+      @AttributeDefinition(name = "Component TTL", description = "\"Time to live\" cache header for rendered component (in seconds)")
+      String include$_$filter_config_ttl() default "";
+
+      @AttributeDefinition(name = "Required header", description = "SDI will work only for requests with given header")
+      String include$_$filter_config_required__header() default "Server-Agent=Communique-Dispatcher";
+
+      @AttributeDefinition(name = "Ignore URL params", description = "SDI will process the request even if it contains configured GET parameters", cardinality = Integer.MAX_VALUE)
+      String include$_$filter_config_ignoreUrlParams() default "";
+
+      @AttributeDefinition(name =  "Include path rewriting", description = "Check to enable include path rewriting")
+      boolean include$_$filter_config_rewrite() default false;
+      
+      @AttributeDefinition(name =  "Append suffix to dynamic includes", description = "Check to append the suffix of the parent request to the dynamic include.")
+      boolean include$_$filter_config_appendSuffix() default true;
+  }
 
   private static final Logger LOG = LoggerFactory.getLogger(Configuration.class);
 
-  static final String PROPERTY_FILTER_PATH = "include-filter.config.path";
-
-  static final String DEFAULT_FILTER_PATH = "/content";
-
-  static final String PROPERTY_FILTER_ENABLED = "include-filter.config.enabled";
-
-  static final boolean DEFAULT_FILTER_ENABLED = false;
-
-  static final String PROPERTY_FILTER_RESOURCE_TYPES = "include-filter.config.resource-types";
-
-  static final String PROPERTY_FILTER_SELECTOR = "include-filter.config.selector";
-
-  static final String DEFAULT_FILTER_SELECTOR = "nocache";
-
-  static final String PROPERTY_EXTENSION = "include-filter.config.extension";
-
-  static final String DEFAULT_EXTENSION = "";
-
-  static final String PROPERTY_COMPONENT_TTL = "include-filter.config.ttl";
-
-  static final String PROPERTY_INCLUDE_TYPE = "include-filter.config.include-type";
-
-  static final String DEFAULT_INCLUDE_TYPE = "SSI";
-
-  static final String PROPERTY_ADD_COMMENT = "include-filter.config.add_comment";
-
-  static final boolean DEFAULT_ADD_COMMENT = false;
-
-  static final String PROPERTY_REQUIRED_HEADER = "include-filter.config.required_header";
-
-  static final String DEFAULT_REQUIRED_HEADER = "Server-Agent=Communique-Dispatcher";
-
-  static final String PROPERTY_IGNORE_URL_PARAMS = "include-filter.config.ignoreUrlParams";
-
-  static final String PROPERTY_REWRITE_PATH = "include-filter.config.rewrite";
-
-  static final String NAME_HINT_PROPERTY_NAME = "webconsole.configurationFactory.nameHint";
-
-  static final String NAME_HINT_VALUE = "{" + PROPERTY_INCLUDE_TYPE + "} for [{"
-            + PROPERTY_FILTER_RESOURCE_TYPES + "}] at path: {" + PROPERTY_FILTER_PATH + "}";
-
-  static final boolean DEFAULT_REWRITE_DISABLED = false;
-
-  static final String PROPERTY_APPEND_SUFFIX = "include-filter.config.appendSuffix";
-
-  static final boolean DEFAULT_APPEND_SUFFIX = true;
-
   private PathMatcher pathMatcher;
 
   private boolean isEnabled;
@@ -141,12 +123,12 @@ public class Configuration {
   private boolean appendSuffix;
 
   @Activate
-  public void activate(ComponentContext context, Map<String, ?> properties) {
-    isEnabled = PropertiesUtil.toBoolean(properties.get(PROPERTY_FILTER_ENABLED), DEFAULT_FILTER_ENABLED);
-    String pathPattern = PropertiesUtil.toString(properties.get(PROPERTY_FILTER_PATH), DEFAULT_FILTER_PATH);
+  public void activate(Config cfg) {
+    isEnabled = cfg.include$_$filter_config_enabled();
+    String pathPattern = cfg.include$_$filter_config_path();
     pathMatcher = choosePathMatcher(pathPattern);
     String[] resourceTypeList;
-    resourceTypeList = PropertiesUtil.toStringArray(properties.get(PROPERTY_FILTER_RESOURCE_TYPES), new String[0]);
+    resourceTypeList = PropertiesUtil.toStringArray(cfg.include$_$filter_config_resource$_$types(), new String[0]);
     for (int i = 0; i < resourceTypeList.length; i++) {
       String[] s = resourceTypeList[i].split(";");
       String name = s[0].trim();
@@ -154,16 +136,16 @@ public class Configuration {
     }
     this.resourceTypes = Arrays.asList(resourceTypeList);
 
-    includeSelector = PropertiesUtil.toString(properties.get(PROPERTY_FILTER_SELECTOR), DEFAULT_FILTER_SELECTOR);
-    extension = PropertiesUtil.toString(properties.get(PROPERTY_EXTENSION), DEFAULT_EXTENSION);
-    ttl = PropertiesUtil.toInteger(properties.get(PROPERTY_COMPONENT_TTL), -1);
-    addComment = PropertiesUtil.toBoolean(properties.get(PROPERTY_ADD_COMMENT), DEFAULT_ADD_COMMENT);
-    includeTypeName = PropertiesUtil.toString(properties.get(PROPERTY_INCLUDE_TYPE), DEFAULT_INCLUDE_TYPE);
-    requiredHeader = PropertiesUtil.toString(properties.get(PROPERTY_REQUIRED_HEADER), DEFAULT_REQUIRED_HEADER);
-    ignoreUrlParams = Arrays.asList(PropertiesUtil.toStringArray(properties.get(PROPERTY_IGNORE_URL_PARAMS),
+    includeSelector = cfg.include$_$filter_config_selector();
+    extension = cfg.include$_$filter_config_extension();
+    ttl = PropertiesUtil.toInteger(cfg.include$_$filter_config_ttl(), -1);
+    addComment = cfg.include$_$filter_config_add__comment();
+    includeTypeName = cfg.include$_$filter_config_include$_$type();
+    requiredHeader = cfg.include$_$filter_config_required__header();
+    ignoreUrlParams = Arrays.asList(PropertiesUtil.toStringArray(cfg.include$_$filter_config_ignoreUrlParams(),
         new String[0]));
-    rewritePath = PropertiesUtil.toBoolean(properties.get(PROPERTY_REWRITE_PATH), DEFAULT_REWRITE_DISABLED);
-    appendSuffix = PropertiesUtil.toBoolean(properties.get(PROPERTY_APPEND_SUFFIX), DEFAULT_APPEND_SUFFIX);
+    rewritePath = cfg.include$_$filter_config_rewrite();
+    appendSuffix = cfg.include$_$filter_config_appendSuffix();
   }
 
   private PathMatcher choosePathMatcher(String pathPattern) {
diff --git a/src/main/java/org/apache/sling/dynamicinclude/ConfigurationWhiteboard.java b/src/main/java/org/apache/sling/dynamicinclude/ConfigurationWhiteboard.java
index 377fbe7..5755dcf 100644
--- a/src/main/java/org/apache/sling/dynamicinclude/ConfigurationWhiteboard.java
+++ b/src/main/java/org/apache/sling/dynamicinclude/ConfigurationWhiteboard.java
@@ -19,23 +19,23 @@
 
 package org.apache.sling.dynamicinclude;
 
-import java.util.Set;
+import static org.osgi.service.component.annotations.FieldOption.UPDATE;
+import static org.osgi.service.component.annotations.ReferenceCardinality.MULTIPLE;
+import static org.osgi.service.component.annotations.ReferencePolicy.DYNAMIC;
+
+import java.util.Collection;
 import java.util.concurrent.CopyOnWriteArraySet;
 
-import java.util.regex.Matcher;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.ReferenceCardinality;
-import org.apache.felix.scr.annotations.ReferencePolicy;
-import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.api.SlingHttpServletRequest;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
 
-@Component
-@Service(ConfigurationWhiteboard.class)
+@Component(service = ConfigurationWhiteboard.class)
 public class ConfigurationWhiteboard {
 
-    @Reference(referenceInterface = Configuration.class, cardinality = ReferenceCardinality.OPTIONAL_MULTIPLE, policy = ReferencePolicy.DYNAMIC)
-    private Set<Configuration> configs = new CopyOnWriteArraySet<Configuration>();
+    @Reference(service = Configuration.class, cardinality = MULTIPLE, policy = DYNAMIC, fieldOption = UPDATE)
+    // declared Collection due to SLING-8986
+    private volatile Collection<Configuration> configs = new CopyOnWriteArraySet<Configuration>();
 
     public Configuration getConfiguration(SlingHttpServletRequest request, String resourceType) {
         for (Configuration c : configs) {
@@ -50,12 +50,9 @@ public class ConfigurationWhiteboard {
         final String requestPath = request.getRequestPathInfo().getResourcePath();
         return config.isEnabled() && config.getPathMatcher().match(requestPath);
     }
-
-    protected void bindConfigs(final Configuration config) {
+    
+    // visible for testing
+    void bindConfigs(final Configuration config) {
         configs.add(config);
     }
-
-    protected void unbindConfigs(final Configuration config) {
-        configs.remove(config);
-    }
 }
diff --git a/src/main/java/org/apache/sling/dynamicinclude/IncludeTagFilter.java b/src/main/java/org/apache/sling/dynamicinclude/IncludeTagFilter.java
index 66bdba8..396984b 100644
--- a/src/main/java/org/apache/sling/dynamicinclude/IncludeTagFilter.java
+++ b/src/main/java/org/apache/sling/dynamicinclude/IncludeTagFilter.java
@@ -35,19 +35,22 @@ import javax.servlet.ServletResponse;
 
 import org.apache.commons.lang3.StringEscapeUtils;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.sling.SlingFilter;
-import org.apache.felix.scr.annotations.sling.SlingFilterScope;
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceUtil;
 import org.apache.sling.dynamicinclude.generator.IncludeGenerator;
 import org.apache.sling.dynamicinclude.generator.IncludeGeneratorWhiteboard;
 import org.apache.sling.dynamicinclude.impl.UrlBuilder;
+import org.apache.sling.servlets.annotations.SlingServletFilter;
+import org.apache.sling.servlets.annotations.SlingServletFilterScope;
+import org.osgi.framework.Constants;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-@SlingFilter(scope = SlingFilterScope.INCLUDE, order = -500)
+@SlingServletFilter(scope = SlingServletFilterScope.INCLUDE)
+@Component(property = { Constants.SERVICE_RANKING + ":Integer=-500"} )
 public class IncludeTagFilter implements Filter {
 
     private static final Logger LOG = LoggerFactory.getLogger(IncludeTagFilter.class);
diff --git a/src/main/java/org/apache/sling/dynamicinclude/SyntheticResourceFilter.java b/src/main/java/org/apache/sling/dynamicinclude/SyntheticResourceFilter.java
index ef02a96..5073fec 100644
--- a/src/main/java/org/apache/sling/dynamicinclude/SyntheticResourceFilter.java
+++ b/src/main/java/org/apache/sling/dynamicinclude/SyntheticResourceFilter.java
@@ -30,24 +30,21 @@ import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 
 import org.apache.commons.lang3.StringUtils;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Properties;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.request.RequestDispatcherOptions;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceUtil;
-import org.apache.sling.engine.EngineConstants;
+import org.apache.sling.servlets.annotations.SlingServletFilter;
+import org.apache.sling.servlets.annotations.SlingServletFilterScope;
 import org.osgi.framework.Constants;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
 
-@Component(metatype = true, label = "Apache Sling Dynamic Include - Synthetic Resource Filter")
-@Service
-@Properties({
-        @Property(name = Constants.SERVICE_VENDOR, value = "The Apache Software Foundation"),
-        @Property(name = EngineConstants.SLING_FILTER_SCOPE, value = EngineConstants.FILTER_SCOPE_REQUEST, propertyPrivate = true),
-        @Property(name = Constants.SERVICE_RANKING, intValue = Integer.MIN_VALUE, propertyPrivate = false) })
+@SlingServletFilter(scope = SlingServletFilterScope.REQUEST)
+@Component(property = { 
+    Constants.SERVICE_RANKING + ":Integer=" + Integer.MIN_VALUE,
+    Constants.SERVICE_VENDOR  +"=The Apache Software Foundation"
+})
 public class SyntheticResourceFilter implements Filter {
 
     @Reference
diff --git a/src/main/java/org/apache/sling/dynamicinclude/generator/IncludeGeneratorWhiteboard.java b/src/main/java/org/apache/sling/dynamicinclude/generator/IncludeGeneratorWhiteboard.java
index aaaaf1a..8294744 100755
--- a/src/main/java/org/apache/sling/dynamicinclude/generator/IncludeGeneratorWhiteboard.java
+++ b/src/main/java/org/apache/sling/dynamicinclude/generator/IncludeGeneratorWhiteboard.java
@@ -19,24 +19,24 @@
 
 package org.apache.sling.dynamicinclude.generator;
 
+import static org.osgi.service.component.annotations.FieldOption.UPDATE;
+import static org.osgi.service.component.annotations.ReferenceCardinality.MULTIPLE;
+import static org.osgi.service.component.annotations.ReferencePolicy.DYNAMIC;
+
 import java.util.Set;
 import java.util.concurrent.CopyOnWriteArraySet;
 
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.ReferenceCardinality;
-import org.apache.felix.scr.annotations.ReferencePolicy;
-import org.apache.felix.scr.annotations.Service;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
 
 /**
  * Service that provides include generator of given type.
  */
 
-@Component
-@Service(IncludeGeneratorWhiteboard.class)
+@Component(service = IncludeGeneratorWhiteboard.class)
 public class IncludeGeneratorWhiteboard {
 
-    @Reference(referenceInterface = IncludeGenerator.class, cardinality = ReferenceCardinality.MANDATORY_MULTIPLE, policy = ReferencePolicy.DYNAMIC)
+    @Reference(service = IncludeGenerator.class, cardinality = MULTIPLE, policy = DYNAMIC, fieldOption = UPDATE)
     private Set<IncludeGenerator> generators = new CopyOnWriteArraySet<IncludeGenerator>();
 
     public IncludeGenerator getGenerator(String type) {
@@ -47,13 +47,4 @@ public class IncludeGeneratorWhiteboard {
         }
         return null;
     }
-
-    void bindGenerators(IncludeGenerator generator) {
-        generators.add(generator);
-    }
-
-    void unbindGenerators(IncludeGenerator generator) {
-        generators.remove(generator);
-    }
-
 }
diff --git a/src/main/java/org/apache/sling/dynamicinclude/generator/package-info.java b/src/main/java/org/apache/sling/dynamicinclude/generator/package-info.java
index 91d2fc9..823689b 100644
--- a/src/main/java/org/apache/sling/dynamicinclude/generator/package-info.java
+++ b/src/main/java/org/apache/sling/dynamicinclude/generator/package-info.java
@@ -18,5 +18,4 @@
  */
 @Version("3.0.0")
 package org.apache.sling.dynamicinclude.generator;
-import aQute.bnd.annotation.Version;
-
+import org.osgi.annotation.versioning.Version;
diff --git a/src/main/java/org/apache/sling/dynamicinclude/generator/types/EsiGenerator.java b/src/main/java/org/apache/sling/dynamicinclude/generator/types/EsiGenerator.java
index 0e89283..0d47fcd 100755
--- a/src/main/java/org/apache/sling/dynamicinclude/generator/types/EsiGenerator.java
+++ b/src/main/java/org/apache/sling/dynamicinclude/generator/types/EsiGenerator.java
@@ -20,15 +20,13 @@
 package org.apache.sling.dynamicinclude.generator.types;
 
 import org.apache.commons.lang3.StringEscapeUtils;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.dynamicinclude.generator.IncludeGenerator;
+import org.osgi.service.component.annotations.Component;
 
 /**
  * ESI include generator
  */
 @Component
-@Service
 public class EsiGenerator implements IncludeGenerator {
     private static final String GENERATOR_NAME = "ESI";
 
diff --git a/src/main/java/org/apache/sling/dynamicinclude/generator/types/JsiGenerator.java b/src/main/java/org/apache/sling/dynamicinclude/generator/types/JsiGenerator.java
index a251a24..a796022 100755
--- a/src/main/java/org/apache/sling/dynamicinclude/generator/types/JsiGenerator.java
+++ b/src/main/java/org/apache/sling/dynamicinclude/generator/types/JsiGenerator.java
@@ -27,11 +27,10 @@ import java.io.UnsupportedEncodingException;
 import java.net.URL;
 
 import org.apache.commons.lang3.StringEscapeUtils;
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.dynamicinclude.generator.IncludeGenerator;
 import org.osgi.service.component.ComponentContext;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -39,7 +38,6 @@ import org.slf4j.LoggerFactory;
  * Client side include generator - using Ajax/JQuery.
  */
 @Component
-@Service
 public class JsiGenerator implements IncludeGenerator {
     private static final String TEMPLATE_FILENAME = "generators/jquery.html";
 
diff --git a/src/main/java/org/apache/sling/dynamicinclude/generator/types/SsiGenerator.java b/src/main/java/org/apache/sling/dynamicinclude/generator/types/SsiGenerator.java
index efa5712..718d506 100755
--- a/src/main/java/org/apache/sling/dynamicinclude/generator/types/SsiGenerator.java
+++ b/src/main/java/org/apache/sling/dynamicinclude/generator/types/SsiGenerator.java
@@ -19,15 +19,13 @@
 
 package org.apache.sling.dynamicinclude.generator.types;
 
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.dynamicinclude.generator.IncludeGenerator;
+import org.osgi.service.component.annotations.Component;
 
 /**
  * Apache SSI include generator
  */
 @Component
-@Service
 public class SsiGenerator implements IncludeGenerator {
     private static final String GENERATOR_NAME = "SSI";
 
diff --git a/src/main/java/org/apache/sling/dynamicinclude/generator/types/package-info.java b/src/main/java/org/apache/sling/dynamicinclude/generator/types/package-info.java
index 2ffbf94..41f423e 100644
--- a/src/main/java/org/apache/sling/dynamicinclude/generator/types/package-info.java
+++ b/src/main/java/org/apache/sling/dynamicinclude/generator/types/package-info.java
@@ -18,5 +18,4 @@
  */
 @Version("3.0.0")
 package org.apache.sling.dynamicinclude.generator.types;
-import aQute.bnd.annotation.Version;
-
+import org.osgi.annotation.versioning.Version;
diff --git a/src/main/java/org/apache/sling/dynamicinclude/package-info.java b/src/main/java/org/apache/sling/dynamicinclude/package-info.java
index 70512f2..20757e4 100644
--- a/src/main/java/org/apache/sling/dynamicinclude/package-info.java
+++ b/src/main/java/org/apache/sling/dynamicinclude/package-info.java
@@ -18,5 +18,4 @@
  */
 @Version("4.2.1")
 package org.apache.sling.dynamicinclude;
-import aQute.bnd.annotation.Version;
-
+import org.osgi.annotation.versioning.Version;
diff --git a/src/main/java/org/apache/sling/dynamicinclude/pathmatcher/package-info.java b/src/main/java/org/apache/sling/dynamicinclude/pathmatcher/package-info.java
index 1eb7026..e067a58 100644
--- a/src/main/java/org/apache/sling/dynamicinclude/pathmatcher/package-info.java
+++ b/src/main/java/org/apache/sling/dynamicinclude/pathmatcher/package-info.java
@@ -18,5 +18,4 @@
  */
 @Version("3.0.0")
 package org.apache.sling.dynamicinclude.pathmatcher;
-import aQute.bnd.annotation.Version;
-
+import org.osgi.annotation.versioning.Version;
diff --git a/src/test/java/org/apache/sling/dynamicinclude/ConfigurationTest.java b/src/test/java/org/apache/sling/dynamicinclude/ConfigurationTest.java
index d430458..85cdf8a 100644
--- a/src/test/java/org/apache/sling/dynamicinclude/ConfigurationTest.java
+++ b/src/test/java/org/apache/sling/dynamicinclude/ConfigurationTest.java
@@ -24,40 +24,42 @@ import static org.hamcrest.MatcherAssert.assertThat;
 
 import java.util.HashMap;
 import java.util.Map;
-import java.util.regex.PatternSyntaxException;
 import org.apache.sling.dynamicinclude.pathmatcher.PrefixPathMatcher;
+import org.apache.sling.testing.mock.osgi.junit.OsgiContext;
 import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 
 public class ConfigurationTest {
 
   private Configuration tested;
+  
+  @Rule
+  public final OsgiContext context = new OsgiContext();
 
   @Before
   public void setUp() {
     tested = new Configuration();
   }
 
-  @Test(expected = PatternSyntaxException.class)
+  @Test(expected = RuntimeException.class)
   public void shouldThrowExceptionWhenRegexisInvalid() throws Exception {
-    Map<String, Object> properties = new HashMap<String, Object>();
-    properties.put(Configuration.PROPERTY_FILTER_PATH, "^(");
-
-    tested.activate(null, properties);
+      
+    context.registerInjectActivateService(tested, "include-filter.config.path", "^(");
   }
 
   @Test
   public void shouldSetDefaultValuesWhenPropertiesAreEmpty() throws Exception {
     Map<String, Object> properties = new HashMap<String, Object>();
 
-    tested.activate(null, properties);
+    context.registerInjectActivateService(tested, properties);
 
     assertThat(tested.getPathMatcher().getClass().isAssignableFrom(PrefixPathMatcher.class), is(true));
     assertThat(tested.getAddComment(), is(false));
     assertThat(tested.getIgnoreUrlParams().size(), is(0));
-    assertThat(tested.getIncludeSelector(), is(Configuration.DEFAULT_FILTER_SELECTOR));
-    assertThat(tested.getIncludeTypeName(), is(Configuration.DEFAULT_INCLUDE_TYPE));
-    assertThat(tested.getRequiredHeader(), is(Configuration.DEFAULT_REQUIRED_HEADER));
+    assertThat(tested.getIncludeSelector(), is("nocache"));
+    assertThat(tested.getIncludeTypeName(), is("SSI"));
+    assertThat(tested.getRequiredHeader(), is("Server-Agent=Communique-Dispatcher"));
     assertThat(tested.getTtl(), is(-1));
     assertThat(tested.isEnabled(), is(false));
     assertThat(tested.hasTtlSet(), is(false));
@@ -67,18 +69,18 @@ public class ConfigurationTest {
   @Test
   public void shouldSetConfigurationValues() throws Exception {
     Map<String, Object> properties = new HashMap<String, Object>();
-    properties.put(Configuration.PROPERTY_FILTER_PATH, "/content/test/path");
-    properties.put(Configuration.PROPERTY_INCLUDE_TYPE, "ESI");
-    properties.put(Configuration.PROPERTY_ADD_COMMENT, true);
-    properties.put(Configuration.PROPERTY_COMPONENT_TTL, 60);
-    properties.put(Configuration.PROPERTY_FILTER_ENABLED, true);
-    properties.put(Configuration.PROPERTY_FILTER_RESOURCE_TYPES, new String[]{"test/resource/type"});
-    properties.put(Configuration.PROPERTY_REQUIRED_HEADER, "CustomHeader: value");
-    properties.put(Configuration.PROPERTY_FILTER_SELECTOR, "cache");
-    properties.put(Configuration.PROPERTY_REWRITE_PATH, true);
-    properties.put(Configuration.PROPERTY_IGNORE_URL_PARAMS, new String[] {"query"});
+    properties.put("include-filter.config.path", "/content/test/path");
+    properties.put("include-filter.config.include-type", "ESI");
+    properties.put("include-filter.config.add_comment", true);
+    properties.put("include-filter.config.ttl", 60);
+    properties.put("include-filter.config.enabled", true);
+    properties.put("include-filter.config.resource-types", new String[]{"test/resource/type"});
+    properties.put("include-filter.config.required_header", "CustomHeader: value");
+    properties.put("include-filter.config.selector", "cache");
+    properties.put("include-filter.config.rewrite", true);
+    properties.put("include-filter.config.ignoreUrlParams", new String[] {"query"});
 
-    tested.activate(null, properties);
+    context.registerInjectActivateService(tested, properties);
 
     assertThat(tested.getPathMatcher().getClass().isAssignableFrom(PrefixPathMatcher.class), is(true));
     assertThat(tested.getAddComment(), is(true));
diff --git a/src/test/java/org/apache/sling/dynamicinclude/ConfigurationWhiteboardTest.java b/src/test/java/org/apache/sling/dynamicinclude/ConfigurationWhiteboardTest.java
index c32e4d9..b53326b 100644
--- a/src/test/java/org/apache/sling/dynamicinclude/ConfigurationWhiteboardTest.java
+++ b/src/test/java/org/apache/sling/dynamicinclude/ConfigurationWhiteboardTest.java
@@ -18,9 +18,6 @@
  */
 package org.apache.sling.dynamicinclude;
 
-import static org.apache.sling.dynamicinclude.Configuration.PROPERTY_FILTER_ENABLED;
-import static org.apache.sling.dynamicinclude.Configuration.PROPERTY_FILTER_PATH;
-import static org.apache.sling.dynamicinclude.Configuration.PROPERTY_FILTER_RESOURCE_TYPES;
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.CoreMatchers.nullValue;
 import static org.hamcrest.MatcherAssert.assertThat;
@@ -28,9 +25,12 @@ import static org.mockito.Mockito.when;
 
 import java.util.HashMap;
 import java.util.Map;
+
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.request.RequestPathInfo;
+import org.apache.sling.testing.mock.osgi.junit.OsgiContext;
 import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
@@ -38,9 +38,12 @@ import org.mockito.junit.MockitoJUnitRunner;
 
 @RunWith(MockitoJUnitRunner.class)
 public class ConfigurationWhiteboardTest {
-
+    
   private static final String TEST_RESOURCE_PATH = "/content/test/engl/home/pageresource";
   public static final String TEST_RESOURCE_TYPE = "test/component/resourceType";
+  
+  @Rule
+  public final OsgiContext context = new OsgiContext();
 
   private ConfigurationWhiteboard tested;
 
@@ -60,11 +63,11 @@ public class ConfigurationWhiteboardTest {
   private Configuration buildConfiguration(boolean enabled, String pathRegex, String[] resourceTypes) {
     Configuration configuration = new Configuration();
     Map<String, Object> properties = new HashMap<String, Object>();
-    properties.put(PROPERTY_FILTER_ENABLED, enabled);
-    properties.put(PROPERTY_FILTER_PATH, pathRegex);
-    properties.put(PROPERTY_FILTER_RESOURCE_TYPES, resourceTypes);
-    configuration.activate(null, properties);
-    return configuration;
+    properties.put("include-filter.config.enabled", enabled);
+    properties.put("include-filter.config.path", pathRegex);
+    properties.put("include-filter.config.resource-types", resourceTypes);
+    
+    return context.registerInjectActivateService(configuration, properties);
   }
 
   @Test
@@ -74,25 +77,25 @@ public class ConfigurationWhiteboardTest {
 
   @Test
   public void shouldNotReturnConfigurationIfResourceTypeDoesNotMatch() throws Exception {
-    Configuration testConfiguration = buildConfiguration(true, "^/content.*$", new String[]{"invalid/resourceType"});
-    tested.bindConfigs(testConfiguration);
+    buildConfiguration(true, "^/content.*$", new String[]{"invalid/resourceType"});
+    context.registerInjectActivateService(tested);
 
     assertThat(tested.getConfiguration(request, TEST_RESOURCE_TYPE), is(nullValue()));
   }
 
   @Test
   public void shouldNotReturnConfigurationIfConfigurationIsDisabled() throws Exception {
-    Configuration testConfiguration = buildConfiguration(false, "^/content.*$", new String[]{TEST_RESOURCE_TYPE});
-    tested.bindConfigs(testConfiguration);
+    buildConfiguration(false, "^/content.*$", new String[]{TEST_RESOURCE_TYPE});
+    context.registerInjectActivateService(tested);
 
     assertThat(tested.getConfiguration(request, TEST_RESOURCE_TYPE), is(nullValue()));
   }
 
   @Test
   public void shouldNotReturnConfigurationIfPathDoesNotMatchRegex() throws Exception {
-    Configuration testConfiguration = buildConfiguration(true, "^/content/notMatched/.*$",
+    buildConfiguration(true, "^/content/notMatched/.*$",
         new String[]{TEST_RESOURCE_TYPE});
-    tested.bindConfigs(testConfiguration);
+    context.registerInjectActivateService(tested);
 
     assertThat(tested.getConfiguration(request, TEST_RESOURCE_TYPE), is(nullValue()));
   }
@@ -100,7 +103,7 @@ public class ConfigurationWhiteboardTest {
   @Test
   public void shouldReturnValidConfiguration() throws Exception {
     Configuration testConfiguration = buildConfiguration(true, "^/content.*$", new String[]{TEST_RESOURCE_TYPE});
-    tested.bindConfigs(testConfiguration);
+    context.registerInjectActivateService(tested);
 
     assertThat(tested.getConfiguration(request, TEST_RESOURCE_TYPE), is(testConfiguration));
   }


[sling-org-apache-sling-dynamic-include] 02/03: SLING-8982 - dynamic-include: upgrade to parent pom 35

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-dynamic-include.git

commit 56028e78f4235836b87ab0753c3e00d86e1c649e
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Fri Jan 10 14:01:11 2020 +0100

    SLING-8982 - dynamic-include: upgrade to parent pom 35
    
    Bump version numbers, following bnd recommendations.
---
 pom.xml                                                                 | 2 +-
 .../java/org/apache/sling/dynamicinclude/generator/package-info.java    | 2 +-
 .../org/apache/sling/dynamicinclude/generator/types/package-info.java   | 2 +-
 src/main/java/org/apache/sling/dynamicinclude/package-info.java         | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 244c94a..9d95b7b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
     </parent>    
     
     <artifactId>org.apache.sling.dynamic-include</artifactId>
-    <version>3.1.7-SNAPSHOT</version>
+    <version>4.0.0-SNAPSHOT</version>
     
     <name>Apache Sling Dynamic Include</name>
     <description>Dynamic Include filter for Apache Sling</description>
diff --git a/src/main/java/org/apache/sling/dynamicinclude/generator/package-info.java b/src/main/java/org/apache/sling/dynamicinclude/generator/package-info.java
index 823689b..1ed8374 100644
--- a/src/main/java/org/apache/sling/dynamicinclude/generator/package-info.java
+++ b/src/main/java/org/apache/sling/dynamicinclude/generator/package-info.java
@@ -16,6 +16,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-@Version("3.0.0")
+@Version("3.0.1")
 package org.apache.sling.dynamicinclude.generator;
 import org.osgi.annotation.versioning.Version;
diff --git a/src/main/java/org/apache/sling/dynamicinclude/generator/types/package-info.java b/src/main/java/org/apache/sling/dynamicinclude/generator/types/package-info.java
index 41f423e..64f2366 100644
--- a/src/main/java/org/apache/sling/dynamicinclude/generator/types/package-info.java
+++ b/src/main/java/org/apache/sling/dynamicinclude/generator/types/package-info.java
@@ -16,6 +16,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-@Version("3.0.0")
+@Version("3.0.1")
 package org.apache.sling.dynamicinclude.generator.types;
 import org.osgi.annotation.versioning.Version;
diff --git a/src/main/java/org/apache/sling/dynamicinclude/package-info.java b/src/main/java/org/apache/sling/dynamicinclude/package-info.java
index 20757e4..e18c789 100644
--- a/src/main/java/org/apache/sling/dynamicinclude/package-info.java
+++ b/src/main/java/org/apache/sling/dynamicinclude/package-info.java
@@ -16,6 +16,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-@Version("4.2.1")
+@Version("5.0.0")
 package org.apache.sling.dynamicinclude;
 import org.osgi.annotation.versioning.Version;


[sling-org-apache-sling-dynamic-include] 03/03: SLING-8987 - Review exported packages

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-dynamic-include.git

commit 268133272fa9f62da8a71303566c76939f0a244c
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Fri Jan 10 15:18:54 2020 +0100

    SLING-8987 - Review exported packages
    
    Remove all package exports, on the assumption that they are not used. The major
    version bump remains, to signal the potentially breaking change.
---
 pom.xml                                             |  4 ----
 .../dynamicinclude/generator/package-info.java      | 21 ---------------------
 .../generator/types/package-info.java               | 21 ---------------------
 .../apache/sling/dynamicinclude/package-info.java   | 21 ---------------------
 .../dynamicinclude/pathmatcher/package-info.java    | 21 ---------------------
 5 files changed, 88 deletions(-)

diff --git a/pom.xml b/pom.xml
index 9d95b7b..7522919 100644
--- a/pom.xml
+++ b/pom.xml
@@ -68,10 +68,6 @@
         </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.annotation.versioning</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
             <artifactId>org.osgi.service.component.annotations</artifactId>
         </dependency>
         <dependency>
diff --git a/src/main/java/org/apache/sling/dynamicinclude/generator/package-info.java b/src/main/java/org/apache/sling/dynamicinclude/generator/package-info.java
deleted file mode 100644
index 1ed8374..0000000
--- a/src/main/java/org/apache/sling/dynamicinclude/generator/package-info.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * 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.
- */
-@Version("3.0.1")
-package org.apache.sling.dynamicinclude.generator;
-import org.osgi.annotation.versioning.Version;
diff --git a/src/main/java/org/apache/sling/dynamicinclude/generator/types/package-info.java b/src/main/java/org/apache/sling/dynamicinclude/generator/types/package-info.java
deleted file mode 100644
index 64f2366..0000000
--- a/src/main/java/org/apache/sling/dynamicinclude/generator/types/package-info.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * 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.
- */
-@Version("3.0.1")
-package org.apache.sling.dynamicinclude.generator.types;
-import org.osgi.annotation.versioning.Version;
diff --git a/src/main/java/org/apache/sling/dynamicinclude/package-info.java b/src/main/java/org/apache/sling/dynamicinclude/package-info.java
deleted file mode 100644
index e18c789..0000000
--- a/src/main/java/org/apache/sling/dynamicinclude/package-info.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * 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.
- */
-@Version("5.0.0")
-package org.apache.sling.dynamicinclude;
-import org.osgi.annotation.versioning.Version;
diff --git a/src/main/java/org/apache/sling/dynamicinclude/pathmatcher/package-info.java b/src/main/java/org/apache/sling/dynamicinclude/pathmatcher/package-info.java
deleted file mode 100644
index e067a58..0000000
--- a/src/main/java/org/apache/sling/dynamicinclude/pathmatcher/package-info.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * 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.
- */
-@Version("3.0.0")
-package org.apache.sling.dynamicinclude.pathmatcher;
-import org.osgi.annotation.versioning.Version;