Running DITA-OT embedded into another Java Project

14 views
Skip to first unread message

pulgupta

unread,
Sep 1, 2022, 11:43:26 PM9/1/22
to DITA-OT Users
Hi Team,

Do we have some samples on how we can embed DITA-OT into our existing Java projects so that it is not running as a separate process?
We have some references at https://www.dita-ot.org/dev/reference/java-api.html but I am not able to understand how to package the whole DITA-OT with all its dependencies into my maven application.

Regards,
Pulkit

Radu Coravu

unread,
Sep 2, 2022, 12:10:26 AM9/2/22
to pulgupta, DITA-OT Users
As far as I know there is no public Maven artifact which contains the entire DITA Open Toolkit distribution.
The DITA Open Toolkit is not just a JAR library or a set of JAR libraries, it is an entire folder which contains various ANT build files, XSLT stylesheets, JAR libraries. So you would probably need to copy and distribute it as it is inside your project.

--
You received this message because you are subscribed to the Google Groups "DITA-OT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dita-ot-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/dita-ot-users/a4b6efb8-6f83-415c-afb0-535ed23a394dn%40googlegroups.com.

pulgupta

unread,
Sep 2, 2022, 12:14:02 AM9/2/22
to DITA-OT Users
Hi Radu,

Distribution is okay and we can do that. I am trying to optimise the number of JVM running for the conversion.
What I was looking at is running DITA-OT on the same JVM which is running my application containing our HTTP API and our business logic.
This will help us to avoid spanning a new jvm from our application just to run DITA-OT.

Regards,
Pulkit

Radu Coravu

unread,
Sep 2, 2022, 12:24:13 AM9/2/22
to pulgupta, DITA-OT Users
Hi,

So maybe you can add to your pom.xml references to all the JAR libraries in the "DITA-OT/lib" folder as "provided" and then try to run the Java process as indicated here:

Regards,
Radu

Jarno Elovirta

unread,
Sep 2, 2022, 4:20:47 AM9/2/22
to pulgupta, DITA-OT Users
You should have DITA-OT distribution package as unzipped directory, all JAR files and config dir in your applications classpath, and path of dist dir passed to DITA-OT when you invoke the Procesor class.

Note that with large input sets, DITA-OT can run your JVM out of memory, crashing your application. That’s why many people run DITA-OT in a separate JVM.

J

--
Sent from a mobile device.

On 2. Sep 2022, at 7.14, pulgupta <pulg...@gmail.com> wrote:

Hi Radu,
Reply all
Reply to author
Forward
0 new messages