diff --git a/.github/workflows/maven-ci.yml b/.github/workflows/maven-ci.yml index febb6fe2ff..2c510c1564 100644 --- a/.github/workflows/maven-ci.yml +++ b/.github/workflows/maven-ci.yml @@ -11,6 +11,7 @@ on: - 'log/**' - 'webconsole/**' - 'framework/**' + - 'healthcheck/**' pull_request: branches: [ "master" ] paths: @@ -22,6 +23,7 @@ on: - 'log/**' - 'framework/**' - 'gogo/**' + - 'healthcheck/**' permissions: {} @@ -65,6 +67,8 @@ jobs: - 'framework/**' gogo: - 'gogo/**' + healthcheck: + - 'healthcheck/**' - name: Felix SCR if: steps.changes.outputs.scr == 'true' @@ -93,6 +97,9 @@ jobs: - name: Felix Gogo Shell if: steps.changes.outputs.gogo == 'true' run: mvn -B -V -Dstyle.color=always --file gogo/pom.xml clean verify + - name: Felix Healthcheck core + if: steps.changes.outputs.healthcheck == 'true' + run: mvn -B -V -Dstyle.color=always --file healthcheck/core/pom.xml clean verify - name: Upload Test Results if: always() uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 diff --git a/healthcheck/core/src/main/java/org/apache/felix/hc/core/impl/servlet/HealthCheckExecutorServlet.java b/healthcheck/core/src/main/java/org/apache/felix/hc/core/impl/servlet/HealthCheckExecutorServlet.java index 5c1ca17601..ad1818dce6 100644 --- a/healthcheck/core/src/main/java/org/apache/felix/hc/core/impl/servlet/HealthCheckExecutorServlet.java +++ b/healthcheck/core/src/main/java/org/apache/felix/hc/core/impl/servlet/HealthCheckExecutorServlet.java @@ -20,6 +20,7 @@ import static org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT; import static org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME; import static org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN; +import static org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_NAME; import java.io.IOException; import java.io.PrintWriter; @@ -253,6 +254,8 @@ public void deactivate() { private void registerServlet(final ServletInfoDTO servletInfo) { final Dictionary properties = new Hashtable<>(); + // FELIX-6791 Add unique servlet name + properties.put(HTTP_WHITEBOARD_SERVLET_NAME, servletInfo.contextName + "." + servletInfo.servletPath + "." + servletInfo.servlet.getClass().getSimpleName()); if (servletInfo.contextName != null && !servletInfo.contextName.isEmpty()) { properties.put(HTTP_WHITEBOARD_CONTEXT_SELECT, "(".concat(HTTP_WHITEBOARD_CONTEXT_NAME).concat("=").concat(servletInfo.contextName).concat(")")); }