How to run DITA-OT within a JAR packaged using Maven? #4229
-
I have added the Then added DITA-OT 3.7.3 as a resource (excluding the The issue is you need to supply a File pointing to the DITA-OT directory (https://javadoc.io/doc/org.dita-ot/dost/latest/org/dita/dost/ProcessorFactory.html), was attempting to use this code to access it via a resource path:
However when I call Also attempted to construct the File in a different way, to little success as it causes a different error when calling run on the Processor:
Am I missing something obvious about how to construct this File object or is it just not possible to package our JAR like this with DITA-OT included within it? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
@karlfranks the org.dita-ot.dost Maven project is useful just to compile Java extensions. |
Beta Was this translation helpful? Give feedback.
-
@jelovirt @infotexture in my opinion the API topic should be removed completely: https://www.dita-ot.org/dev/reference/java-api.html |
Beta Was this translation helpful? Give feedback.
You can run DITA-OT using the Java API but you have to set up the environment so that the DITA-OT distribution is expanded into a directory, not in a JAR. In your case the error message
Shows that the URL returned from classloader gives you back a JAR URI and that doesn't work.