Skip to content

Running Luminescent under Maven

Wendell Piez edited this page Feb 11, 2016 · 7 revisions

Running Luminescent under Maven

Maven is basically a build tool for Java -- a framework used by developers to manage and package complex code bases, from development through deployment.

But we can use it much more simply and directly as an execution framework. This has the following advantages:

  1. We don't have to download and install Java applications locally, just Maven. Maven takes care of all the jar files and what not.
  2. Helps us manage and test updates to maintain compatibility and stability going forward.
  3. Gives us a single control point (the pom.xml) for all functions - removing dependencies on local (platform-dependent) scripts -- up to a point, supporting a virtual "shell" for projects.

Running Luminescent under Maven

Install Maven. Confirm that it is installed using mvn -version from the command line.

Cocoon

  • Run a web server supporting access to Luminescent processing configured via Cocoon sitemap.

To do this, copy Luminescent into a working directory on your system.

From a command line, change directories (cd) to cocoon in the Luminescent distribution. Then execute mvn jetty:run.

A bunch of stuff should happen. If all is well, the system will pause when it has set up a server on port 8888. When this happens, you should see Luminescent visible here:

localhost:8888/Luminescent/lmnl

... from which you can navigate to other pages produced by Luminescent.

If all is not well with Cocoon under Maven, it will typically fritz out with an error message or traceback. Let me know so we can troubleshoot these.

XProc (not yet under Maven)

  • Run a processing pipeline that syntax-checks LMNL syntax

An XProc pipeline that can syntax-check a LMNL syntax instance can be a useful thing to have within an editing environment. This can be done using a local installation of XML Calabash (an XProc pipeline processor) or calling it under Maven. I haven't figured out quite exactly how to do that last bit.

BaseX (not yet under Maven)

Run BaseX to provide two services:

  • Run a web server supporting access to Luminescent processing configured via RestXQ
    • Capability for a RESTful interface (API over http) not dissimilar from Cocoon
    • BaseX can call the same processing pipelines as Cocoon and execute them very efficiently
    • XQuery access to results including intermediate results is really powerful
  • Run the BaseX GUI to provide for dynamic query development over LMNL documents in Luminescent, interactively

As of yet I have scripts to make it possible to run BaseX over selected texts in the test dbs. Both GUI and http access via BaseX have been demonstrated in principle.

All of these run locally, so they do not require network access (once Maven has downloaded and installed all the components the first time).

Can a single POM offer all these? or should they be split apart?

Use cases

  • Explore markup of more examples / enrich and extend current examples
  • Customized views SVG and other
    • Tweak existing XSLTs
    • Fork them instead
    • Plug in new pipelines
  • Browse collections of these (eg Shakespeare, sonnets, novels)
    • "Contact sheets" showing many at once?
  • Compile/update a document in the db
  • Validate markup in editor
  • User queries of document set? (BaseX GUI?)

Notes on running BaseX under Maven should be shared with the BaseX wiki

Hints

Clean up maven (clear local repository and allow to re update everything)

mvn dependency:purge-local-repository