Here’s what I have working from my little Ant deployment script:
<target name="build-basex-zip-package"
depends="init, clean"
description="Prepares the files for
the BaseX now-xquery repo Zip module package"
>
<mkdir dir="${basex.zip.package.dir}/com/servicenow/xquery/module"/>
<!-- The BaseX convention is that the package namespace URI is translated to a directory path,
i.e., com/servicenow/xquery/module/ that then contains the module file.
-->
<copy todir="${basex.zip.package.dir}/com/servicenow/xquery/module">
<fileset dir="${xquery.src}/modules">
<include name="*"/>
</fileset>
</copy>
</target>
<target name="package-basex-zip-package" depends="build-basex-zip-package"
description="Packages the now-xquery package as Zip file"
>
<zip basedir="${basex.zip.package.dir}"
destfile="${target.dir}/${basex.zip.package.name}.zip"
>
<include name="**/*"/>
</zip>
</target>
<target name="deploy-now-modules-to-basex" depends="package-basex-zip-package"
description="Deploys the now-xquery module package to the BaseX repo directory"
>
<exec executable="${basex.command}"
>
<arg value="-c"/>
<arg value="xquery archive:extract-to(db:option('repopath'), fetch:binary('${target.dir}/${basex.zip.package.name}.zip'))"/>
</exec>
<exec executable="${basex.command}"
>
<arg value="-c"/>
<arg value="repo list"/>
</exec>
</target>
I’m making a Zip file to allow for a future where the Zip file is fetched from somewhere else but for now the source is on the same server as BaseX so I just deploy from there. Easy peasy.
Ideally I’d be doing this via Maven but I haven’t quite gotten there yet.
Cheers,
E.
_____________________________________________
Eliot Kimber
Sr Staff Content Engineer
O: 512 554 9368
M: 512 554 9368
LinkedIn | Twitter | YouTube | Facebook
From:
Christian Grün <christian.gruen@gmail.com>
Date: Monday, January 24, 2022 at 1:31 PM
To: Eliot Kimber <eliot.kimber@servicenow.com>
Cc: BaseX <basex-talk@mailman.uni-konstanz.de>
Subject: Re: [basex-talk] Unable to Make My Custom EXPath Module Work
[External Email]
> I see that I can just directly install the individual module files, i.e.:
> repo install file:/Users/eliot.kimber/git/dita-build-tools/src/main/xquery/modules/now-dita-utils.xqm
True! I overlooked that one. With the repo:install, it can optionally
be combined with a FLWOR expression.