Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .sling-module.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"jenkins": {
"jdks": [17, 21]
}
}
211 changes: 83 additions & 128 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling-bundle-parent</artifactId>
<version>48</version>
<version>60</version>
<relativePath />
</parent>

Expand All @@ -38,110 +38,26 @@
<connection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-event.git</connection>
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-event.git</developerConnection>
<url>https://github.com/apache/sling-org-apache-sling-event.git</url>
<tag>org.apache.sling.event-4.3.12</tag>
</scm>

<properties>
<site.jira.version.id>12315369</site.jira.version.id>
<org.ops4j.pax.exam.version>4.13.3</org.ops4j.pax.exam.version>
<min.port>37000</min.port>
<max.port>37999</max.port>
<sling.java.version>11</sling.java.version>
<project.build.outputTimestamp>2023-10-05T16:16:32Z</project.build.outputTimestamp>
</properties>


<build>
<plugins>
<!-- plain unit tests -->
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>reserve-network-port</id>
<goals>
<goal>reserve-network-port</goal>
</goals>
<phase>pre-integration-test</phase>
<configuration>
<portNames>
<portName>http.port</portName>
</portNames>
<minPortNumber>${min.port}</minPortNumber>
<maxPortNumber>${max.port}</maxPortNumber>
</configuration>
</execution>
</executions>
</plugin>
<!-- integration tests run with pax-exam -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<systemPropertyVariables combine.children="append">
<bundle.filename>${basedir}/target/${project.build.finalName}.jar</bundle.filename>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.servicemix.tooling</groupId>
<artifactId>depends-maven-plugin</artifactId>
</plugin>
<plugin><!-- workaround for https://issues.apache.org/jira/browse/SM-5021 -->
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.3</version>
<executions>
<execution>
<id>fix-depends-RB</id>
<phase>process-resources</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<file>${project.build.directory}/classes/META-INF/maven/dependencies.properties</file>
<replacements>
<replacement>
<token># Generated at: .+</token>
<value>#</value>
</replacement>
</replacements>
<regex>true</regex>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>port-java8</id>
<activation>
<activeByDefault>false</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<min.port>38000</min.port>
<max.port>38999</max.port>
</properties>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.service.component.annotations</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.service.metatype.annotations</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
Expand All @@ -163,14 +79,17 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.core</artifactId>
<artifactId>org.osgi.framework</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.cmpn</artifactId>
<artifactId>org.osgi.service.event</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
Expand All @@ -181,13 +100,19 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.api</artifactId>
<version>2.11.0</version>
<version>2.22.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.event.api</artifactId>
<version>1.0.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.commons.osgi</artifactId>
<version>2.1.0</version>
<version>2.4.0</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -203,21 +128,21 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-core</artifactId>
<version>3.2.4</version>
<groupId>io.dropwizard.metrics</groupId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.serviceusermapper</artifactId>
<version>1.2.0</version>
<version>1.5.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-jcr-commons</artifactId>
<version>2.11.2</version>
<version>2.20.9</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -230,11 +155,13 @@
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- Testing -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
Expand All @@ -244,7 +171,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.11.0</version>
<version>5.14.2</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -255,20 +182,14 @@
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.commons.json</artifactId>
<version>2.0.20</version>
<artifactId>org.apache.sling.testing.sling-mock-oak</artifactId>
<version>3.1.0-1.40.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.testing.sling-mock</artifactId>
<version>2.2.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.testing.sling-mock-oak</artifactId>
<version>3.1.0-1.40.0</version>
<artifactId>org.apache.sling.testing.sling-mock.junit4</artifactId>
<version>3.4.18</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -295,17 +216,6 @@
<artifactId>javax.inject</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.event.api</artifactId>
<version>1.0.4</version>
</dependency>

<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.commons.testing</artifactId>
<version>2.0.10</version>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.testing.paxexam</artifactId>
Expand All @@ -330,13 +240,6 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
<version>4.13.1</version>
</dependency>
<dependency>
<groupId>org.jmock</groupId>
<artifactId>jmock-junit4</artifactId>
<version>2.8.2</version>
<scope>test</scope>
</dependency>

<!-- Pax Exam -->
Expand Down Expand Up @@ -378,4 +281,56 @@
</dependency>

</dependencies>

<build>
<plugins>
<!-- plain unit tests -->
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>reserve-network-port</id>
<goals>
<goal>reserve-network-port</goal>
</goals>
<phase>pre-integration-test</phase>
<configuration>
<portNames>
<portName>http.port</portName>
</portNames>
<minPortNumber>${min.port}</minPortNumber>
<maxPortNumber>${max.port}</maxPortNumber>
</configuration>
</execution>
</executions>
</plugin>
<!-- integration tests run with pax-exam -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<systemPropertyVariables combine.children="append">
<bundle.filename>${basedir}/target/${project.build.finalName}.jar</bundle.filename>
</systemPropertyVariables>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.servicemix.tooling</groupId>
<artifactId>depends-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,20 @@
* This component needs to be immediate to set the global variables
* (application id and thread pool).
*/
@Component(immediate=true,
property = {
Constants.SERVICE_VENDOR + "=The Apache Software Foundation"
},
service={EnvironmentComponent.class})
@Component(
immediate = true,
property = {Constants.SERVICE_VENDOR + "=The Apache Software Foundation"},
service = {EnvironmentComponent.class})
public class EnvironmentComponent {

/**
* Our thread pool.
*/
@Reference(service=EventingThreadPool.class, policyOption=ReferencePolicyOption.GREEDY)
@Reference(service = EventingThreadPool.class, policyOption = ReferencePolicyOption.GREEDY)
private ThreadPool threadPool;

/** Sling settings service. */
@Reference(policyOption=ReferencePolicyOption.GREEDY)
@Reference(policyOption = ReferencePolicyOption.GREEDY)
private SlingSettingsService settingsService;

/**
Expand All @@ -69,7 +68,7 @@ protected void activate() {
@Deactivate
protected void deactivate() {
// Unset the thread pool
if ( Environment.THREAD_POOL == this.threadPool ) {
if (Environment.THREAD_POOL == this.threadPool) {
Environment.THREAD_POOL = null;
}
}
Expand All @@ -79,7 +78,7 @@ protected void bindThreadPool(final EventingThreadPool etp) {
}

protected void unbindThreadPool(final EventingThreadPool etp) {
if ( this.threadPool == etp ) {
if (this.threadPool == etp) {
this.threadPool = null;
}
}
Expand Down
Loading