Re: #DITA-OT Manual build file failing #DITA-OT


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


On Tue, Jul 26, 2022, 8:14 AM mdawson7 via groups.io <mdawson7=slb.com@groups.io> wrote:
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.

Join {main@dita-users.groups.io to automatically receive all group messages.