diff --git a/elemental-api/elemental-expath-pkg-mgmt-api/pom.xml b/elemental-api/elemental-expath-pkg-mgmt-api/pom.xml
new file mode 100644
index 0000000000..b7ff5447ff
--- /dev/null
+++ b/elemental-api/elemental-expath-pkg-mgmt-api/pom.xml
@@ -0,0 +1,151 @@
+
+
+
+ 4.0.0
+
+
+ xyz.elemental
+ elemental-api
+ 7.7.1-SNAPSHOT
+ ..
+
+
+ elemental-expath-pkg-mgmt-api
+
+ Elemental EXPath Package Management API
+ HTTP API for managing EXPath Packages in Elemental
+
+
+ scm:git:https://github.com/evolvedbinary/elemental.git
+ scm:git:https://github.com/evolvedbinary/elemental.git
+ scm:git:https://github.com/evolvedbinary/elemental.git
+ HEAD
+
+
+
+
+ jakarta.servlet
+ jakarta.servlet-api
+
+
+
+ xyz.elemental.fork.org.exist-db
+ exist-core
+ ${project.version}
+ test
+
+
+
+ junit
+ junit
+ test
+
+
+
+ org.apache.httpcomponents
+ fluent-hc
+ test
+
+
+
+ org.apache.httpcomponents
+ httpcore
+ test
+
+
+
+
+ org.eclipse.jetty
+ jetty-deploy
+ test
+
+
+ org.eclipse.jetty
+ jetty-jmx
+ test
+
+
+
+ org.xmlunit
+ xmlunit-core
+ test
+
+
+
+
+
+
+ src/test/resources
+ false
+
+
+ src/test/resources-filtered
+ true
+
+
+
+
+ com.mycila
+ license-maven-plugin
+
+
+
+ ${project.parent.relativePath}/../elemental-parent/FDB-backport-to-EDB-LGPL-21-ONLY-license.template.txt
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+
+ ${project.basedir}/../../exist-jetty-config/target/classes/org/exist/jetty
+ ${project.build.testOutputDirectory}/conf.xml
+ ${project.build.testOutputDirectory}/standalone-webapp
+ ${project.build.testOutputDirectory}/log4j2.xml
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/elemental-api/elemental-expath-pkg-mgmt-api/src/main/java/xyz/elemental/api/expath/pkg/mgmt/ExpathPkgMgmtServlet.java b/elemental-api/elemental-expath-pkg-mgmt-api/src/main/java/xyz/elemental/api/expath/pkg/mgmt/ExpathPkgMgmtServlet.java
new file mode 100644
index 0000000000..eeecb326d9
--- /dev/null
+++ b/elemental-api/elemental-expath-pkg-mgmt-api/src/main/java/xyz/elemental/api/expath/pkg/mgmt/ExpathPkgMgmtServlet.java
@@ -0,0 +1,17 @@
+package xyz.elemental.api.expath.pkg.mgmt;
+
+import jakarta.servlet.http.HttpServlet;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+
+import java.io.IOException;
+
+public class ExpathPkgMgmtServlet extends HttpServlet {
+
+ @Override
+ protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws IOException {
+ response.setStatus(HttpServletResponse.SC_OK);
+ response.setContentType("application/xml");
+ response.getWriter().write("world");
+ }
+}
diff --git a/elemental-api/elemental-expath-pkg-mgmt-api/src/test/java/xyz/elemental/api/expath/pkg/mgmt/ExpathPkgMgmtServletTest.java b/elemental-api/elemental-expath-pkg-mgmt-api/src/test/java/xyz/elemental/api/expath/pkg/mgmt/ExpathPkgMgmtServletTest.java
new file mode 100644
index 0000000000..650b7ae03d
--- /dev/null
+++ b/elemental-api/elemental-expath-pkg-mgmt-api/src/test/java/xyz/elemental/api/expath/pkg/mgmt/ExpathPkgMgmtServletTest.java
@@ -0,0 +1,64 @@
+package xyz.elemental.api.expath.pkg.mgmt;
+
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.HttpStatus;
+import org.apache.http.client.fluent.Request;
+import org.exist.test.ExistWebServer;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.xmlunit.builder.DiffBuilder;
+import org.xmlunit.builder.Input;
+import org.xmlunit.diff.Diff;
+
+import javax.xml.transform.Source;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+
+public class ExpathPkgMgmtServletTest {
+
+ @ClassRule
+ public static final ExistWebServer existWebServer = new ExistWebServer(true, false, true, true);
+
+ private static String getPackageUri() {
+ return "http://localhost:" + existWebServer.getPort() + "/expath/package/";
+ }
+
+ @Test
+ public void packageQuery() throws IOException {
+ final HttpResponse response = Request.Get(getPackageUri())
+ .execute()
+ .returnResponse();
+ final int resultStatusCode = response.getStatusLine().getStatusCode();
+ assertEquals("Server returned response code: " + resultStatusCode, HttpStatus.SC_OK, resultStatusCode);
+ final String responseBody = readResponse(response.getEntity());
+
+ final Source expectedSource = Input.from("").build();
+ final Source actualSource = Input.from(responseBody).build();
+ final Diff diff = DiffBuilder.compare(expectedSource)
+ .withTest(actualSource)
+ .checkForSimilar()
+ .build();
+
+ assertFalse(diff.toString(), diff.hasDifferences());
+ }
+
+ private String readResponse(final HttpEntity response) throws IOException {
+ try (final InputStream is = response.getContent();
+ final BufferedReader reader = new BufferedReader(new InputStreamReader(is, UTF_8))) {
+ String line;
+ final StringBuilder out = new StringBuilder();
+ while ((line = reader.readLine()) != null) {
+ out.append(line);
+ out.append("\r\n");
+ }
+ return out.toString();
+ }
+ }
+}
\ No newline at end of file
diff --git a/elemental-api/elemental-expath-pkg-mgmt-api/src/test/resources-filtered/conf.xml b/elemental-api/elemental-expath-pkg-mgmt-api/src/test/resources-filtered/conf.xml
new file mode 100644
index 0000000000..8d57f08dfe
--- /dev/null
+++ b/elemental-api/elemental-expath-pkg-mgmt-api/src/test/resources-filtered/conf.xml
@@ -0,0 +1,160 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/elemental-api/elemental-expath-pkg-mgmt-api/src/test/resources/log4j2.xml b/elemental-api/elemental-expath-pkg-mgmt-api/src/test/resources/log4j2.xml
new file mode 100644
index 0000000000..f061d56ce8
--- /dev/null
+++ b/elemental-api/elemental-expath-pkg-mgmt-api/src/test/resources/log4j2.xml
@@ -0,0 +1,259 @@
+
+
+
+
+ ${log4j:configParentLocation}/../../target/test-logs-${date:yyyyMMddHHmmssSSS}
+ 10MB
+ 0 0 0 * * ?
+ 14
+ %d{yyyyMMddHHmmss}
+ %d{yyyy-MM-dd}
+ %d [%t] %-5p (%F [%M]:%L) - %m%n
+ %m%n
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/elemental-api/elemental-expath-pkg-mgmt-api/src/test/resources/standalone-webapp/WEB-INF/controller-config.xml b/elemental-api/elemental-expath-pkg-mgmt-api/src/test/resources/standalone-webapp/WEB-INF/controller-config.xml
new file mode 100644
index 0000000000..3c477d2246
--- /dev/null
+++ b/elemental-api/elemental-expath-pkg-mgmt-api/src/test/resources/standalone-webapp/WEB-INF/controller-config.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/elemental-api/elemental-expath-pkg-mgmt-api/src/test/resources/standalone-webapp/WEB-INF/web.xml b/elemental-api/elemental-expath-pkg-mgmt-api/src/test/resources/standalone-webapp/WEB-INF/web.xml
new file mode 100644
index 0000000000..eb0aa0e602
--- /dev/null
+++ b/elemental-api/elemental-expath-pkg-mgmt-api/src/test/resources/standalone-webapp/WEB-INF/web.xml
@@ -0,0 +1,109 @@
+
+
+
+
+ Elemental – NoSQL Database
+ Elemental
+
+
+ org.exist.xmlrpc.RpcServlet
+ org.exist.xmlrpc.RpcServlet
+
+ enabledForExtensions
+ true
+
+
+
+
+ EXistServlet
+ org.exist.http.servlets.EXistServlet
+
+ configuration
+ conf.xml
+
+
+ basedir
+ WEB-INF/
+
+
+ start
+ true
+
+ 2
+
+
+
+ XQueryURLRewrite
+ org.exist.http.urlrewrite.XQueryURLRewrite
+
+ config
+ WEB-INF/controller-config.xml
+
+
+
+
+ XSLTServlet
+ org.exist.http.servlets.XSLTServlet
+
+
+
+ ExpathPkgMgmtServlet
+ xyz.elemental.api.expath.pkg.mgmt.ExpathPkgMgmtServlet
+
+
+
+ XQueryURLRewrite
+ /*
+
+
diff --git a/elemental-api/pom.xml b/elemental-api/pom.xml
new file mode 100644
index 0000000000..5c6ca077f9
--- /dev/null
+++ b/elemental-api/pom.xml
@@ -0,0 +1,84 @@
+
+
+
+ 4.0.0
+
+
+ xyz.elemental
+ elemental-parent
+ 7.7.1-SNAPSHOT
+ ../elemental-parent
+
+
+
+ elemental-api
+ pom
+
+ Elemental APIs
+ APIs for Elemental
+
+
+ scm:git:https://github.com/evolvedbinary/elemental.git
+ scm:git:https://github.com/evolvedbinary/elemental.git
+ scm:git:https://github.com/evolvedbinary/elemental.git
+ HEAD
+
+
+
+ elemental-expath-pkg-mgmt-api
+
+
+
+
+
+ com.mycila
+ license-maven-plugin
+
+
+
+ ${project.parent.relativePath}/FDB-backport-to-EDB-LGPL-21-ONLY-license.template.txt
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/elemental-parent/pom.xml b/elemental-parent/pom.xml
index 0c3d3e2598..1e1f644ea4 100644
--- a/elemental-parent/pom.xml
+++ b/elemental-parent/pom.xml
@@ -106,6 +106,11 @@
4.0.6
2.0.17
9.9.1-8
+ 4.13.2
+ 4.5.14
+ 4.4.16
+ 11.0.26
+ 2.11.0
1C
@@ -161,6 +166,56 @@
${slf4j.version}
+
+ jakarta.servlet
+ jakarta.servlet-api
+ 5.0.0
+
+
+
+ org.apache.httpcomponents
+ httpcore
+ ${apache.httpcomponents.core.version}
+
+
+
+ org.apache.httpcomponents
+ fluent-hc
+ ${apache.httpcomponents.version}
+
+
+
+ junit
+ junit
+ ${junit.version}
+
+
+
+
+ org.hamcrest
+ hamcrest-core
+
+
+
+
+
+ org.eclipse.jetty
+ jetty-deploy
+ ${jetty.version}
+
+
+
+ org.eclipse.jetty
+ jetty-jmx
+ ${jetty.version}
+
+
+
+ org.xmlunit
+ xmlunit-core
+ ${xmlunit.version}
+
+
jakarta.activation
jakarta.activation-api
diff --git a/exist-distribution/pom.xml b/exist-distribution/pom.xml
index 13dff82df5..78375fe749 100644
--- a/exist-distribution/pom.xml
+++ b/exist-distribution/pom.xml
@@ -81,6 +81,12 @@
+
+ xyz.elemental
+ elemental-expath-pkg-mgmt-api
+ ${project.version}
+ runtime
+
${project.groupId}
exist-core
diff --git a/exist-jetty-config/src/main/resources/standalone-webapp/WEB-INF/controller-config.xml b/exist-jetty-config/src/main/resources/standalone-webapp/WEB-INF/controller-config.xml
index 622b986ea5..7603883acf 100644
--- a/exist-jetty-config/src/main/resources/standalone-webapp/WEB-INF/controller-config.xml
+++ b/exist-jetty-config/src/main/resources/standalone-webapp/WEB-INF/controller-config.xml
@@ -19,6 +19,9 @@
+
+
+
+
+ ExpathPkgMgmtServlet
+ xyz.elemental.api.expath.pkg.mgmt.ExpathPkgMgmtServlet
+
+
+
+
+
diff --git a/exist-jetty-config/src/main/resources/webapp/WEB-INF/web.xml b/exist-jetty-config/src/main/resources/webapp/WEB-INF/web.xml
index 83d7303cba..13165d425f 100644
--- a/exist-jetty-config/src/main/resources/webapp/WEB-INF/web.xml
+++ b/exist-jetty-config/src/main/resources/webapp/WEB-INF/web.xml
@@ -270,6 +270,14 @@
org.exist.webstart.JnlpServlet
+
+
+ ExpathPkgMgmtServlet
+ xyz.elemental.api.expath.pkg.mgmt.ExpathPkgMgmtServlet
+
+
-
-
-
- org.hamcrest
- hamcrest-core
-
-
-
+
org.hamcrest
hamcrest
diff --git a/pom.xml b/pom.xml
index 6b7d1bb789..3fed2b11fe 100644
--- a/pom.xml
+++ b/pom.xml
@@ -46,6 +46,7 @@
elemental-parent
+ elemental-api
elemental-media-type
exist-parent
exist-ant