Date
1 - 6 of 6
#DITA-OT Manual build file failing #DITA-OT
mdawson7@...
I am currently working my way through 'Dita for Print' 2nd edition and I am struggling with the exercise 'Create an ANT build file'. I have created the ANT file and a batch file to run it - I am confident these are both set up correctly.
The error message in the log is: BUILD FAILED
C:\Users\mdawson7\Buildfiles\IXreleasenotes.ant:7: The following error occurred while executing this line:
C:\Repos\michael-ditaot\dita-ot-3.7\plugins\org.dita.base\build.xml:29: The following error occurred while executing this line:
C:\Repos\michael-ditaot\dita-ot-3.7\plugins\org.dita.pdf2\build.xml:148: The following error occurred while executing this line:
C:\Repos\michael-ditaot\dita-ot-3.7\plugins\org.dita.index\build.xml:5: taskdef class org.dita.index.IndexPreprocessorTask cannot be found
using the classloader AntClassLoader[]
I have found a similar issue in the topic below. https://dita-users.groups.io/g/main/topic/69673114# The answer given in this topic is: "So if you run ANT manually you will need to add extra JAR libraries to the classpath, for example this JAR library below is the one containing the "IndexPreprocessorTask" class: DITA-OT/plugins/org.dita.pdf2/lib/fo.jar" However, I have no idea what this means or how I would achieve this. Or... is there an alternative to using a manual ANT file? During previous study I was using Oxygen to integrate and run builds, but my trial licence expires soon. |
|
Leigh W
Ant build files as described in DITA For Print (thank you, btw) don't work with 3.x versions of the OT as 3.x deprecated the use of the ant command in favor of the dita command. You'll probably find it easiest to use a properties file instead. Your batch file would look something like this: set DITA_DIR=C:\dita-ot-3.5.4\ set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_172\ set TEMP_DIR=Projects\TestShowTrackChanges\_temp set OUTPUT_DIR=Projects\TestShowTrackChanges\_output if exist %TEMP_DIR%\nul rd /q /s %TEMP_DIR% Rem Delete the content of the output folder if exist %OUTPUT_DIR%\nul del /q /s %OUTPUT_DIR%\* call %DITA_DIR%bin\dita --input=Projects\TestShowTrackChanges\TestShowTrackChanges.ditamap --format=pdf --propertyfile=build3x.properties --logfile=build3x.log --verbose --debug and your properties file (in this examples, named "build3x.properties") would look something like this: output.dir = Projects\\TestShowTrackChanges\\_output clean.temp = no dita.temp.dir = Projects\\TestShowTrackChanges\\_temp args.rellinks = none show.changes.and.comments = yes show.changebars = yes With everything set for your environment, of course. You can add additional parameters to the properties file just like you can to the ant build file. Best, Leigh I am currently working my way through 'Dita for Print' 2nd edition and I am struggling with the exercise 'Create an ANT build file'. I have created the ANT file and a batch file to run it - I am confident these are both set up correctly. |
|
mdawson7@...
Thank you, managed to get the build to run with the batch file.
I'm enjoying the book! |
|
Chris Papademetrious
If you are looking to control basic aspects of the transformation:
then perhaps DITA-OT project files might be useful to you: Publishing with project files (dita-ot.org) Here is a blog post that describes how we use preprocessing to implement some additional functionality: Preprocessing DITA-OT Project Files (blog.oxygenxml.com) The upcoming Oxygen v25 release will provide a handy new feature to publish deliverables from a project button just by clicking a "Publish" button beside the deliverable. Or, you can publish them from the command line with dita --project my-project-file.xml --deliverable my-deliverable-name If you have any questions, feel free to ask! - Chris |
|
mdawson7@...
Thanks Chris, looks interesting. I will give it a go.
|
|
Chris Papademetrious
DITA-OT project files are working very well for us. With a single command, we can publish an entire help collection that contains 50+ books in PDF format (PDF Chemistry) -- some in the thousands of pages, with varying profiling conditions, some published multiple times in different conditions -- along with online help (WebHelp) that presents the same content in HTML form, with links to the PDF files from the online help. The DITA-OT project files take care of all the details, the PDF files go where the online help links expect them, all the conditions and parameters are applied as needed. And we have over a dozen help collections, so the complexity management that DITA-OT project files provide is quite useful.
And perhaps most importantly, DITA-OT project files are simple enough that our writers can understand and modify them as books/conditions/etc. are added/removed/changed. - Chris |
|