diff --git a/docs/faq.html b/docs/faq.html index 859c035f8..264a4d83c 100644 --- a/docs/faq.html +++ b/docs/faq.html @@ -356,6 +356,12 @@ Using format="xml", <junit> fails with a NoClassDefFoundError if forked. + +
  • + + <junitreport> doesn't work with JDK 1.5 but + worked fine with JDK 1.4. +
  • @@ -1674,6 +1680,21 @@ mv /tmp/foo $ANT_HOME/bin/antRun <pathelement path="${ant.home}/lib/xml-apis.jar:${ant.home}/lib/xercesImpl.jar"/>

    to your task's <classpath>.

    +

    + + + <junitreport> doesn't work with JDK 1.5 but + worked fine with JDK 1.4. + +

    +

    While JDK 1.4.x contains a version of Xalan-J 2, JDK 1.5 + (and later?) have moved + to XSLTC. Since this task uses Xalan's redirect + extensions for its internal stylesheet, Ant doesn't support + XSLTC yet. This means that you have to install Xalan-J 2 in order + to use this task with JDK 1.5.

    +

    If you want to follow progress on this, here + is the relevant bug report.

    diff --git a/docs/manual/OptionalTasks/junitreport.html b/docs/manual/OptionalTasks/junitreport.html index 880d6d143..e2b61c6f0 100644 --- a/docs/manual/OptionalTasks/junitreport.html +++ b/docs/manual/OptionalTasks/junitreport.html @@ -14,11 +14,17 @@ the Ant distribution. See Library Dependencies for more information.

    Requirements

    -

    The task needs Xalan 2.x; -although -Xalan 1.2.2 -does work, but as Xalan1 is not supported, we do not recommend this. -

    +

    The task needs Xalan +2.x; although Xalan +1.2.2 does work, but as Xalan1 is not supported, we do not +recommend this. While JDK 1.4.x contains a version of Xalan-J 2, JDK +1.5 and later have moved +to XSLTC. Since this task uses Xalan's redirect extensions for +its internal stylesheet, Ant doesn't support XSLTC yet. This means +that you have to install Xalan-J 2 in order to use this task with JDK +1.5.

    If you do you use Xalan 1.2.2 you will need a compatible (older) version of Xerces. as well as BSF(bsf.jar). Again, using Xalan 2 is simpler and supported. diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/XalanExecutor.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/XalanExecutor.java index 599f72471..ad13c6fca 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/XalanExecutor.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/XalanExecutor.java @@ -27,6 +27,7 @@ import java.io.StringWriter; import java.lang.reflect.Field; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; +import org.apache.tools.ant.util.JavaEnvUtils; /** * Command class that encapsulate specific behavior for each @@ -86,8 +87,17 @@ abstract class XalanExecutor { xalan1missing.printStackTrace(new PrintWriter(swr)); caller.task.log("Didn't find Xalan1.", Project.MSG_DEBUG); caller.task.log(swr.toString(), Project.MSG_DEBUG); - throw new BuildException("Could not find xalan2 nor xalan1 " - + "in the classpath. Check http://xml.apache.org/xalan-j"); + String msg = "Could not find xalan2 nor xalan1 " + + "in the classpath. Check http://xml.apache.org/xalan-j/"; + if (!JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1) + && !JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2) + && !JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3) + && !JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_4)) { + msg += "\r\nStarting with JDK 1.5, the built-in processor " + + "of the JDK is no longer Xalan\r\nbut XSLTC which is " + + "not (yet) supported by the junitreport task."; + } + throw new BuildException(msg); } } String version = getXalanVersion(procVersion); diff --git a/xdocs/faq.xml b/xdocs/faq.xml index 95eea2a56..955d3ae42 100644 --- a/xdocs/faq.xml +++ b/xdocs/faq.xml @@ -1490,6 +1490,29 @@ mv /tmp/foo $ANT_HOME/bin/antRun + + + + <junitreport> doesn't work with JDK 1.5 but + worked fine with JDK 1.4. + + + +

    While JDK 1.4.x contains a version of Xalan-J 2, JDK 1.5 + (and later?) have moved + to XSLTC. Since this task uses Xalan's redirect + extensions for its internal stylesheet, Ant doesn't support + XSLTC yet. This means that you have to install Xalan-J 2 in order + to use this task with JDK 1.5.

    + +

    If you want to follow progress on this, here + is the relevant bug report.

    + + + \ No newline at end of file