我下载了 DITA OpenToolkit 1.8 并尝试构建演示。
ant -f build_demo.xml
它一直运行到 mapref 任务,该任务引发如下错误。现在,错误说明出了什么问题,显然是错误的 ICONST 值。但是如果没有人之前实际测试过样本,我会感到非常惊讶,因为无论您选择哪种输出格式都会发生错误,所以很明显。
因此我在想,运行构建时可能缺少任何配置或参数?
mapref:
[mapref] Transforming into C:\Dev\DITA-OT1.8\temp
[mapref] Processing C:\Dev\DITA-OT1.8\temp\hierarchy.ditamap to C:\Dev\DITA-OT1.8\temp\hierarchy.ditamap.ref
[mapref] Loading stylesheet C:\Dev\DITA-OT1.8\xsl\preprocess\mapref.xsl
[mapref] com.sun.org.apache.bcel.internal.generic.ClassGenException: ICONST can be used only for value between -1 and 5: 7
[mapref] at com.sun.org.apache.bcel.internal.generic.ICONST.<init>(ICONST.java:81)
[mapref] at com.sun.org.apache.xalan.internal.xsltc.compiler.Step.translatePredicates(Step.java:419)
[mapref] at com.sun.org.apache.xalan.internal.xsltc.compiler.Step.translateStep(Step.java:243)
[mapref] at com.sun.org.apache.xalan.internal.xsltc.compiler.Step.translate(Step.java:233)
[mapref] at com.sun.org.apache.xalan.internal.xsltc.compiler.AbsoluteLocationPath.translate(AbsoluteLocationPath.java:101)
[mapref] at com.sun.org.apache.xalan.internal.xsltc.compiler.ApplyTemplates.translate(ApplyTemplates.java:174)
[mapref] at com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode.translateContents(SyntaxTreeNode.java:513)
[mapref] at com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode.compileResultTree(SyntaxTreeNode.java:671)
[mapref] at com.sun.org.apache.xalan.internal.xsltc.compiler.VariableBase.translateValue(VariableBase.java:282)
[mapref] at com.sun.org.apache.xalan.internal.xsltc.compiler.Variable.translate(Variable.java:159)
[mapref] at com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode.translateContents(SyntaxTreeNode.java:513)
[mapref] at com.sun.org.apache.xalan.internal.xsltc.compiler.Template.translate(Template.java:335)
[mapref] at com.sun.org.apache.xalan.internal.xsltc.compiler.TopLevelElement.compile(TopLevelElement.java:64)
[mapref] at com.sun.org.apache.xalan.internal.xsltc.compiler.Template.compile(Template.java:44)
[mapref] at com.sun.org.apache.xalan.internal.xsltc.compiler.Mode.compileNamedTemplate(Mode.java:549)
[mapref] at com.sun.org.apache.xalan.internal.xsltc.compiler.Mode.compileTemplates(Mode.java:566)
[mapref] at com.sun.org.apache.xalan.internal.xsltc.compiler.Mode.compileApplyTemplates(Mode.java:818)
[mapref] at com.sun.org.apache.xalan.internal.xsltc.compiler.Stylesheet.compileModes(Stylesheet.java:615)
[mapref] at com.sun.org.apache.xalan.internal.xsltc.compiler.Stylesheet.translate(Stylesheet.java:730)
[mapref] at com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC.compile(XSLTC.java:354)
[mapref] at com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC.compile(XSLTC.java:429)
[mapref] at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:795)
[mapref] at org.apache.tools.ant.taskdefs.optional.TraXLiaison.readTemplates(TraXLiaison.java:300)
[mapref] at org.apache.tools.ant.taskdefs.optional.TraXLiaison.createTransformer(TraXLiaison.java:317)
[mapref] at org.apache.tools.ant.taskdefs.optional.TraXLiaison.transform(TraXLiaison.java:178)
[mapref] at org.apache.tools.ant.taskdefs.XSLTProcess.process(XSLTProcess.java:816)
[mapref] at org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java:406)
[mapref] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[mapref] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[mapref] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[mapref] at java.lang.reflect.Method.invoke(Method.java:597)
[mapref] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[mapref] at org.apache.tools.ant.Task.perform(Task.java:348)
[mapref] at org.apache.tools.ant.Target.execute(Target.java:435)
[mapref] at org.apache.tools.ant.Target.performTasks(Target.java:456)
[mapref] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
[mapref] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
[mapref] at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
[mapref] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:440)
[mapref] at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
[mapref] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[mapref] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[mapref] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[mapref] at java.lang.reflect.Method.invoke(Method.java:597)
[mapref] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[mapref] at org.apache.tools.ant.Task.perform(Task.java:348)
[mapref] at org.apache.tools.ant.Target.execute(Target.java:435)
[mapref] at org.apache.tools.ant.Target.performTasks(Target.java:456)
[mapref] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
[mapref] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
[mapref] at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
[mapref] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:440)
[mapref] at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
[mapref] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[mapref] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[mapref] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[mapref] at java.lang.reflect.Method.invoke(Method.java:597)
[mapref] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[mapref] at org.apache.tools.ant.Task.perform(Task.java:348)
[mapref] at org.apache.tools.ant.Target.execute(Target.java:435)
[mapref] at org.apache.tools.ant.Target.performTasks(Target.java:456)
[mapref] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
[mapref] at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
[mapref] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[mapref] at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
[mapref] at org.apache.tools.ant.Main.runBuild(Main.java:851)
[mapref] at org.apache.tools.ant.Main.startAnt(Main.java:235)
[mapref] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
[mapref] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
[mapref] : Error! ICONST can be used only for value between -1 and 5: 7
[mapref] : Fatal Error! Die Formatvorlage konnte nicht kompiliert werden.
[mapref] Failed to process null