SLING-11354: Upgrade to sling 47 (#1)
diff --git a/bnd.bnd b/bnd.bnd
new file mode 100644
index 0000000..4abb2ca
--- /dev/null
+++ b/bnd.bnd
@@ -0,0 +1,2 @@
+Bundle-Category: sling
+Main-Class: org.apache.sling.reqanalyzer.impl.gui.Main
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index a46b429..6e81663 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,14 +22,13 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.sling</groupId>
- <artifactId>sling</artifactId>
- <version>26</version>
+ <artifactId>sling-bundle-parent</artifactId>
+ <version>47</version>
<relativePath/>
</parent>
<artifactId>org.apache.sling.reqanalyzer</artifactId>
<version>0.0.1-SNAPSHOT</version>
- <packaging>bundle</packaging>
<name>Apache Sling Request Processing Analyzer</name>
<description>
@@ -46,30 +45,24 @@
<connection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-reqanalyzer.git</connection>
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-reqanalyzer.git</developerConnection>
<url>https://gitbox.apache.org/repos/asf?p=sling-org-apache-sling-reqanalyzer.git</url>
+ <tag>HEAD</tag>
</scm>
+ <properties>
+ <sling.java.version>8</sling.java.version>
+ <project.build.outputTimestamp>1</project.build.outputTimestamp>
+ <bnd.baseline.fail.on.missing>false</bnd.baseline.fail.on.missing>
+ </properties>
+
<build>
<plugins>
<plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-scr-plugin</artifactId>
+ <groupId>biz.aQute.bnd</groupId>
+ <artifactId>bnd-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.sling</groupId>
- <artifactId>maven-sling-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-Category>sling</Bundle-Category>
- <Main-Class>
- org.apache.sling.reqanalyzer.impl.gui.Main
- </Main-Class>
- </instructions>
- </configuration>
+ <artifactId>sling-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
@@ -115,20 +108,16 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.scr.annotations</artifactId>
- </dependency>
- <dependency>
<groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
+ <artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>osgi.cmpn</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
@@ -150,8 +139,8 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <version>1.8.2</version>
+ <artifactId>mockito-core</artifactId>
+ <version>4.5.1</version>
<scope>test</scope>
</dependency>
</dependencies>
diff --git a/src/main/java/org/apache/sling/reqanalyzer/impl/RequestAnalysisLogger.java b/src/main/java/org/apache/sling/reqanalyzer/impl/RequestAnalysisLogger.java
index db1efa6..a10c41c 100644
--- a/src/main/java/org/apache/sling/reqanalyzer/impl/RequestAnalysisLogger.java
+++ b/src/main/java/org/apache/sling/reqanalyzer/impl/RequestAnalysisLogger.java
@@ -34,27 +34,25 @@
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletResponse;
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Deactivate;
-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.SlingHttpServletResponse;
import org.apache.sling.api.wrappers.SlingHttpServletResponseWrapper;
import org.apache.sling.engine.EngineConstants;
import org.apache.sling.settings.SlingSettingsService;
import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Deactivate;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.component.propertytypes.ServiceRanking;
-@Component(metatype = false)
-@Service
-@Properties({ @Property(name = EngineConstants.FILTER_NAME, value = "RequestAnalysisLogger"),
- @Property(name = EngineConstants.SLING_FILTER_SCOPE, value = EngineConstants.FILTER_SCOPE_REQUEST),
- @Property(name = Constants.SERVICE_RANKING, intValue = Integer.MAX_VALUE) })
+@Component(service = {RequestAnalysisLogger.class},
+ property = {
+ EngineConstants.FILTER_NAME + "=RequestAnalysisLogger",
+ EngineConstants.SLING_FILTER_SCOPE + "=" + EngineConstants.FILTER_SCOPE_REQUEST,
+ })
+@ServiceRanking(Integer.MAX_VALUE)
public class RequestAnalysisLogger implements Filter {
@Reference