From a41e6e6c3ccb4111ecaeec85baf00b0f3830d727 Mon Sep 17 00:00:00 2001 From: Laurettta Date: Wed, 22 Jul 2026 14:13:41 +0100 Subject: [PATCH 1/3] [bugfix] Patch packageservice XAR to report existdb-compatible version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes https://github.com/evolvedbinary/elemental/issues/225 packageservice.xar was reporting the raw product version instead of the eXist-db compatible one. Build now unzips it, replaces packages:get-version() calls with packages:get-existdb-compatible-version(), and re-zips. Same pattern that was used for the dashboard patch. --- exist-distribution/pom.xml | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/exist-distribution/pom.xml b/exist-distribution/pom.xml index afb9456c5e..5fd75dd2f1 100644 --- a/exist-distribution/pom.xml +++ b/exist-distribution/pom.xml @@ -816,6 +816,50 @@ + + unzip-packageservice + process-resources + + run + + + + + + + + + + + + patch-packageservice + process-resources + + run + + + + + + + + + + zip-patched-packageservice + process-resources + + run + + + + + + + + + + + unzip-monex process-resources From 0e3bf0b06df4b0cee87048cc612a14b083ed308e Mon Sep 17 00:00:00 2001 From: Laurettta Date: Thu, 30 Jul 2026 15:09:58 +0100 Subject: [PATCH 2/3] [refactor] Switch XAR branding/version patches to unified diffs instead of inline Ant replace Dashboard, monex, and packageservice XARs were getting patched via Ant tasks stuffed into the POM, which made each change basically unreviewable on its own. Swapped that for unified diff files under src/xar-patches/{dashboard,monex,packageservice}, applied with patch-maven-plugin. truezip-maven-plugin does the unzip/re-zip of the XARs around it. --- .../dashboard/0002-build-html-title.patch | 7 +++++ .../dashboard/0003-doc-html-title.patch | 11 +++++++ .../dashboard/0004-guest-html-title.patch | 11 +++++++ .../dashboard/0005-index-html-title.patch | 7 +++++ .../dashboard/001-admin-xql-title.patch | 11 +++++++ .../monex/0001-profiling-html-wording.patch | 11 +++++++ .../monex/0002-remotes-html-wording.patch | 29 +++++++++++++++++++ .../0001-exist-compatible-version.patch | 22 ++++++++++++++ 8 files changed, 109 insertions(+) create mode 100644 exist-distribution/src/xar-patches/dashboard/0002-build-html-title.patch create mode 100644 exist-distribution/src/xar-patches/dashboard/0003-doc-html-title.patch create mode 100644 exist-distribution/src/xar-patches/dashboard/0004-guest-html-title.patch create mode 100644 exist-distribution/src/xar-patches/dashboard/0005-index-html-title.patch create mode 100644 exist-distribution/src/xar-patches/dashboard/001-admin-xql-title.patch create mode 100644 exist-distribution/src/xar-patches/monex/0001-profiling-html-wording.patch create mode 100644 exist-distribution/src/xar-patches/monex/0002-remotes-html-wording.patch create mode 100644 exist-distribution/src/xar-patches/packageservice/0001-exist-compatible-version.patch diff --git a/exist-distribution/src/xar-patches/dashboard/0002-build-html-title.patch b/exist-distribution/src/xar-patches/dashboard/0002-build-html-title.patch new file mode 100644 index 0000000000..6359cabf4c --- /dev/null +++ b/exist-distribution/src/xar-patches/dashboard/0002-build-html-title.patch @@ -0,0 +1,7 @@ +--- /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-dashboard-staging/build.html (original) ++++ /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-dashboard-staging/build.html (patched) +@@ -1 +1 @@ +-existdb-dashboard +\ No newline at end of file ++Dashboard :: Elemental +\ No newline at end of file diff --git a/exist-distribution/src/xar-patches/dashboard/0003-doc-html-title.patch b/exist-distribution/src/xar-patches/dashboard/0003-doc-html-title.patch new file mode 100644 index 0000000000..8cac454785 --- /dev/null +++ b/exist-distribution/src/xar-patches/dashboard/0003-doc-html-title.patch @@ -0,0 +1,11 @@ +--- /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-dashboard-staging/doc.html (original) ++++ /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-dashboard-staging/doc.html (patched) +@@ -3,7 +3,7 @@ + + + +- existdb-dashboard ++ Dashboard :: Elemental + + + diff --git a/exist-distribution/src/xar-patches/dashboard/0004-guest-html-title.patch b/exist-distribution/src/xar-patches/dashboard/0004-guest-html-title.patch new file mode 100644 index 0000000000..af4d970404 --- /dev/null +++ b/exist-distribution/src/xar-patches/dashboard/0004-guest-html-title.patch @@ -0,0 +1,11 @@ +--- /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-dashboard-staging/guest.html (original) ++++ /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-dashboard-staging/guest.html (patched) +@@ -3,7 +3,7 @@ + + + +- existdb-dashboard ++ Dashboard :: Elemental + + + diff --git a/exist-distribution/src/xar-patches/dashboard/0005-index-html-title.patch b/exist-distribution/src/xar-patches/dashboard/0005-index-html-title.patch new file mode 100644 index 0000000000..59ab5f8900 --- /dev/null +++ b/exist-distribution/src/xar-patches/dashboard/0005-index-html-title.patch @@ -0,0 +1,7 @@ +--- /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-dashboard-staging/index.html (original) ++++ /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-dashboard-staging/index.html (patched) +@@ -1 +1 @@ +-existdb-dashboard +\ No newline at end of file ++Dashboard :: Elemental +\ No newline at end of file diff --git a/exist-distribution/src/xar-patches/dashboard/001-admin-xql-title.patch b/exist-distribution/src/xar-patches/dashboard/001-admin-xql-title.patch new file mode 100644 index 0000000000..4777847668 --- /dev/null +++ b/exist-distribution/src/xar-patches/dashboard/001-admin-xql-title.patch @@ -0,0 +1,11 @@ +--- /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-dashboard-staging/admin.xql 2026-07-29 08:48:15 ++++ /Users/lauretta/Documents/dashboard-diff-practice/admin-after.xql 2026-07-29 08:50:22 +@@ -14,7 +14,7 @@ + + + +- existdb-dashboard ++ Dashboard :: Elemental + + + \ No newline at end of file diff --git a/exist-distribution/src/xar-patches/monex/0001-profiling-html-wording.patch b/exist-distribution/src/xar-patches/monex/0001-profiling-html-wording.patch new file mode 100644 index 0000000000..26b0f7dc53 --- /dev/null +++ b/exist-distribution/src/xar-patches/monex/0001-profiling-html-wording.patch @@ -0,0 +1,11 @@ +--- /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-monex-staging/profiling.html (original) ++++ /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-monex-staging/profiling.html (patched) +@@ -23,7 +23,7 @@ +
+
+
Enable tracing to start collecting statistics. Run +- queries as usual (through any eXist interface), then press "Refresh" to see ++ queries as usual (through any interface), then press "Refresh" to see + statistics.
+
+
diff --git a/exist-distribution/src/xar-patches/monex/0002-remotes-html-wording.patch b/exist-distribution/src/xar-patches/monex/0002-remotes-html-wording.patch new file mode 100644 index 0000000000..324997ef3a --- /dev/null +++ b/exist-distribution/src/xar-patches/monex/0002-remotes-html-wording.patch @@ -0,0 +1,29 @@ +--- /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-monex-staging/remotes.html (original) ++++ /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-monex-staging/remotes.html (patched) +@@ -61,7 +61,7 @@ +
+ + Alert! +- Remote monitoring requires eXist's scheduler ++ Remote monitoring requires the scheduler + module to be enabled. See extensions/build.properties and + conf.xml. +
+@@ -76,7 +76,7 @@ + responsiveness of the system. Response Time is the elapsed time + until the client received the response.

+

Configuration

+-

To monitor remote eXist-db instances, edit the XML file instances.xml in the root collection of ++

To monitor remote instances, edit the XML file instances.xml in the root collection of + the monex application. Monex pings each server at configurable times or + intervals. You can also set up email alerts in notifications.xml.

+

The configuration for monitoring a remote instance looks as follows:

+@@ -121,7 +121,7 @@ + token + the unique JMX token required to connect to the JMX servlet. This token is generated + for every server and can be found in the file jmxservlet.token +- inside the data directory of the eXist instance. Note: eXist versions before 2.2 ++ inside the data directory of the instance. Note: eXist-db versions before 2.2 + do not use this mechanism, so no token is required. + + diff --git a/exist-distribution/src/xar-patches/packageservice/0001-exist-compatible-version.patch b/exist-distribution/src/xar-patches/packageservice/0001-exist-compatible-version.patch new file mode 100644 index 0000000000..6a818fed3f --- /dev/null +++ b/exist-distribution/src/xar-patches/packageservice/0001-exist-compatible-version.patch @@ -0,0 +1,22 @@ +--- /Users/lauretta/Documents/existdb-packageservice/modules/packages.xqm 2022-02-16 14:33:52 ++++ /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-packageservice-staging/modules/packages.xqm 2026-07-22 13:17:43 +@@ -288,7 +288,7 @@ + (: should be private but there seems to be a bug :) + declare function packages:public-repo-contents($installed as element(repo-app)*) { + try { +- let $url := $config:DEFAULT-REPO || "/public/apps.xml?version=" || packages:get-version() || ++ let $url := $config:DEFAULT-REPO || "/public/apps.xml?version=" || packages:get-existdb-compatible-version() || + "&source=" || util:system-property("product-source") + (: EXPath client module does not work properly. No idea why. :) + let $request := +@@ -323,8 +323,8 @@ + }; + + (: should be private but there seems to be a bug :) +-declare function packages:get-version() { +- (util:system-property("product-semver"), util:system-property("product-version"))[1] ++declare function packages:get-existdb-compatible-version() { ++ util:system-property("exist-db-expath-pkg-compatible-version") + }; + + (: should be private but there seems to be a bug :) From 6219d384a8664ef04c6620ebf4ef6e7cf3455dfd Mon Sep 17 00:00:00 2001 From: Laurettta Date: Fri, 31 Jul 2026 10:16:30 +0100 Subject: [PATCH 3/3] [refactor] Use truezip-maven-plugin to stage/repackage XAR patches --- exist-distribution/pom.xml | 265 ++++++++++++------ .../dashboard/0002-build-html-title.patch | 6 +- .../dashboard/0004-guest-html-title.patch | 6 +- .../dashboard/001-admin-xql-title.patch | 2 +- .../monex/0002-remotes-html-wording.patch | 6 +- 5 files changed, 189 insertions(+), 96 deletions(-) diff --git a/exist-distribution/pom.xml b/exist-distribution/pom.xml index 5fd75dd2f1..4728e3a5fc 100644 --- a/exist-distribution/pom.xml +++ b/exist-distribution/pom.xml @@ -754,6 +754,7 @@ + org.apache.maven.plugins @@ -761,8 +762,8 @@ 3.2.0 - unzip-dashboard - process-resources + resolve-dashboard-xar-path + generate-resources run @@ -770,29 +771,17 @@ - - - - - - - - patch-dashboard + patch-dashboard-branding process-resources run - - - - - @@ -800,129 +789,233 @@ - zip-patched-dashboard - process-resources + resolve-packageservice-xar-path + generate-resources run - - - - - - + + - unzip-packageservice - process-resources + resolve-monex-xar-path + generate-resources run - - - - + + - patch-packageservice + patch-monex-branding process-resources run - - + + + + + + + + + + + org.codehaus.mojo + truezip-maven-plugin + 1.2 + + + unzip-dashboard + generate-resources + copy + + + ${dashboard-xar-path} + ${expath.pkg.dir}-dashboard-staging + + resources/images/existdb.png + resources/images/existdb-web.svg + resources/images/x.svg + + + + + + zip-patched-dashboard + prepare-package + copy + + + ${expath.pkg.dir}-dashboard-staging + ${dashboard-xar-path} + + + + + add-elemental-logo-to-dashboard + prepare-package + copy + + + ${project.build.outputDirectory} + elemental-web.svg + ${dashboard-xar-path}/resources/images + + + + + remove-old-dashboard-branding + prepare-package + remove + + + ${dashboard-xar-path} + + resources/images/existdb.png + resources/images/existdb-web.svg + resources/images/x.svg + + + + + + unzip-packageservice + generate-resources + copy + + + ${packageservice-xar-path} + ${expath.pkg.dir}-packageservice-staging + + + zip-patched-packageservice - process-resources - - run - + prepare-package + copy - - - - - - - + + ${expath.pkg.dir}-packageservice-staging + ${packageservice-xar-path} + unzip-monex - process-resources - - run - + generate-resources + copy - - - - - - - - - - - + + ${monex-xar-path} + ${expath.pkg.dir}-monex-staging + + resources/img/exist_icon_16x16.ico + resources/img/existdb-logo.png + resources/img/powered-by-whiteglass.svg + + - patch-monex + zip-patched-monex + prepare-package + copy + + + ${expath.pkg.dir}-monex-staging + ${monex-xar-path} + + + + + add-elemental-assets-to-monex + prepare-package + copy + + + ${project.build.outputDirectory} + + elemental-favicon.ico + elemental-web.svg + + ${monex-xar-path}/resources/img + + + + + remove-old-monex-branding + prepare-package + remove + + + ${monex-xar-path} + + resources/img/exist_icon_16x16.ico + resources/img/existdb-logo.png + resources/img/powered-by-whiteglass.svg + + + + + + + + + io.github.lukasmansour + patch-maven-plugin + 1.1.0 + + ${expath.pkg.dir}-packageservice-staging + ${project.basedir}/src/xar-patches/packageservice + true + + + + patch-packageservice process-resources - run + apply + + + patch-dashboard + process-resources + apply - - - - - - - - - - - - - + ${expath.pkg.dir}-dashboard-staging + ${project.basedir}/src/xar-patches/dashboard - zip-patched-monex + patch-monex process-resources - - run - + apply - - - - - - - - - + ${expath.pkg.dir}-monex-staging + ${project.basedir}/src/xar-patches/monex + + + com.evolvedbinary.maven.mfrey copy-maven-plugin diff --git a/exist-distribution/src/xar-patches/dashboard/0002-build-html-title.patch b/exist-distribution/src/xar-patches/dashboard/0002-build-html-title.patch index 6359cabf4c..fe8a4b3fe5 100644 --- a/exist-distribution/src/xar-patches/dashboard/0002-build-html-title.patch +++ b/exist-distribution/src/xar-patches/dashboard/0002-build-html-title.patch @@ -1,7 +1,7 @@ ---- /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-dashboard-staging/build.html (original) -+++ /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-dashboard-staging/build.html (patched) +--- /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-dashboard-staging/build.html 2021-09-21 11:43:38 ++++ /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-dashboard-staging/build.html 2026-07-29 09:30:01 @@ -1 +1 @@ -existdb-dashboard \ No newline at end of file +Dashboard :: Elemental -\ No newline at end of file +\ No newline at end of file \ No newline at end of file diff --git a/exist-distribution/src/xar-patches/dashboard/0004-guest-html-title.patch b/exist-distribution/src/xar-patches/dashboard/0004-guest-html-title.patch index af4d970404..109a6a9a50 100644 --- a/exist-distribution/src/xar-patches/dashboard/0004-guest-html-title.patch +++ b/exist-distribution/src/xar-patches/dashboard/0004-guest-html-title.patch @@ -1,5 +1,5 @@ ---- /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-dashboard-staging/guest.html (original) -+++ /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-dashboard-staging/guest.html (patched) +--- /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-dashboard-staging/guest.html 2021-09-21 11:43:38 ++++ /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-dashboard-staging/guest.html 2026-07-29 09:30:01 @@ -3,7 +3,7 @@ @@ -8,4 +8,4 @@ + Dashboard :: Elemental - + \ No newline at end of file diff --git a/exist-distribution/src/xar-patches/dashboard/001-admin-xql-title.patch b/exist-distribution/src/xar-patches/dashboard/001-admin-xql-title.patch index 4777847668..c0aacc98b6 100644 --- a/exist-distribution/src/xar-patches/dashboard/001-admin-xql-title.patch +++ b/exist-distribution/src/xar-patches/dashboard/001-admin-xql-title.patch @@ -1,5 +1,5 @@ --- /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-dashboard-staging/admin.xql 2026-07-29 08:48:15 -+++ /Users/lauretta/Documents/dashboard-diff-practice/admin-after.xql 2026-07-29 08:50:22 ++++ /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-dashboard-staging/admin.xql 2026-07-29 08:50:22 @@ -14,7 +14,7 @@ diff --git a/exist-distribution/src/xar-patches/monex/0002-remotes-html-wording.patch b/exist-distribution/src/xar-patches/monex/0002-remotes-html-wording.patch index 324997ef3a..be0793fa2a 100644 --- a/exist-distribution/src/xar-patches/monex/0002-remotes-html-wording.patch +++ b/exist-distribution/src/xar-patches/monex/0002-remotes-html-wording.patch @@ -1,5 +1,5 @@ ---- /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-monex-staging/remotes.html (original) -+++ /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-monex-staging/remotes.html (patched) +--- /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-monex-staging/remotes.html 2026-05-30 21:12:45 ++++ /Users/lauretta/Documents/evolvedbinary/elemental/exist-distribution/target/expath-pkgs-monex-staging/remotes.html 2026-07-29 09:30:25 @@ -61,7 +61,7 @@
@@ -23,7 +23,7 @@ the unique JMX token required to connect to the JMX servlet. This token is generated for every server and can be found in the file jmxservlet.token - inside the data directory of the eXist instance. Note: eXist versions before 2.2 -+ inside the data directory of the instance. Note: eXist-db versions before 2.2 ++ inside the data directory of the instance. Note: eXist-db versions before 2.2 do not use this mechanism, so no token is required.