Unable to load XML catalog from Gradle

(John Zinger) #1

I’m migrating an ant build file to gradle and have come across this following issue.

The ant build launches a second build file, designating -lib which points to a folder which contains dost.jar & resolver.jar (The code is provided below)

<java classname="org.apache.tools.ant.launch.Launcher" fork="true" failonerror="true">
      <jvmarg value="-Xmx256M" />
        <pathelement location="${ant.home}/lib/ant-launcher.jar" />
      <jvmarg value="-Dant.library.dir=${ant.home}/lib" />
      <arg value="-Djava.awt.headless=true" />
      <arg value="-buildfile" />
      <arg file="build-manual.xml" />
      <arg value="-lib" />
      <arg file="${resource.dir}/lib" />

The task being performed by the launched build file uses a xmlcatalog to run the XSLT task

<xslt classpath="${saxon.jar}"
          <path location="${lib.dir}/dita/catalog-dita.xml" />

I’m trying to forgo launching the task from a launcher and just have the second task run, hence I’ve created the following task

        classpath : "$projectDir/lib/misc/saxon9.jar:$projectDir/lib/misc/saxon9-dom.jar:
    basedir : "manual/dita", style : "$ditaLib/custom/dita2html.xsl", destdir : "$manualBuild") {
  param(name: "xhive.versionname", expression : versionName)
  xmlcatalog {
   catalogpath {
    path(location: "$ditaLib/catalog-dita.xml")

Which falis with the following error

[ant:xslt] Loading stylesheet C:\views\depot\Platform\XDB\Database\rel_XDB_10.5\lib\dita\custom\dita2html.xsl
 Warning: XML resolver not found; external catalogs will be ignored
 [ant:xslt] : Fatal Error! java.io.FileNotFoundException: ...\concept\concept.dtd (The system cannot find the file specified) Cause: java.io.FileNotFoundException: ...\concept\concept.dtd (The system cannot find the file specified)

It seems that somehow the resolver isn’t found even though it’s in the classpath.

Please not that the same issue occurs when I launch the second ant task independently