0

请帮助我解决此错误和警告:

41:警告:'includeantruntime' 未设置,默认为 build.sysclasspath=last;为可重复构建设置为 false

79:应用转换时出错:javax.xml.transform.TransformerException:java.lang.RuntimeException:当安全处理功能设置为 true 时,不允许使用扩展元素“redirect”。

总时间:31秒

这是我的 build.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
          Any modifications will be overwritten.
          To include a user specific buildfile here, simply create one in the same
          directory with the processing instruction <?eclipse.ant.import?>
          as the first entry and export the buildfile again. -->
<project basedir="." default="build" name="Login">
<property environment="env"/>
<property name="ECLIPSE_HOME" value="../../../../opt/eclipse"/>
<property name="junit.output.dir" value="junit"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.6"/>
<property name="source" value="1.6"/>
<path id="Login.classpath">
    <pathelement location="bin"/>
    <pathelement location="../../Downloads/JAR/junit-4.10.jar"/>
    <pathelement location="../../Downloads/JAR/poi-3.2-FINAL.jar"/>
    <pathelement location="../../Downloads/JAR/selenium-java-2.21.0.jar"/>
    <pathelement location="../../Downloads/JAR/selenium-java-2.21.0.zip"/>
    <pathelement location="../../Downloads/JAR/selenium-java-2.21.0-srcs.jar"/>
    <pathelement location="../../Downloads/JAR/selenium-server-standalone-2.21.0.jar"/>
    <pathelement location="../../Downloads/JAR/testng-6.5.1.zip"/>
</path>
<target name="init">
    <mkdir dir="bin"/>
    <copy includeemptydirs="false" todir="bin">
        <fileset dir="src">
            <exclude name="**/*.launch"/>
            <exclude name="**/*.java"/>
        </fileset>
    </copy>
</target>
<target name="clean">
    <delete dir="bin"/>
</target>
<target depends="clean" name="cleanall"/>
<target depends="build-subprojects,build-project" name="build"/>
<target name="build-subprojects"/>
<target depends="init" name="build-project">
    <echo message="${ant.project.name}: ${ant.file}"/>
    <javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">

        <src path="src"/>
        <classpath refid="Login.classpath"/>
    </javac>
</target>
<target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
<target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
    <copy todir="${ant.library.dir}">
        <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
    </copy>
    <unzip dest="${ant.library.dir}">
        <patternset includes="jdtCompilerAdapter.jar"/>
        <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
    </unzip>
</target>
<target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
    <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
    <antcall target="build"/>
</target>
<target name="login.testLogin">
    <mkdir dir="${junit.output.dir}"/>
    <junit fork="yes" printsummary="withOutAndErr">
        <formatter type="xml"/>
        <test name="login" todir="${junit.output.dir}"/>
        <classpath refid="Login.classpath"/>
    </junit>
</target>
<target name="login">
    <mkdir dir="${junit.output.dir}"/>
    <junit fork="yes" printsummary="withOutAndErr">
        <formatter type="xml"/>
        <test name="login" todir="${junit.output.dir}"/>
        <classpath refid="Login.classpath"/>
    </junit>
</target>

<target name="junitreport">
    <junitreport todir="${junit.output.dir}">
        <fileset dir="${junit.output.dir}">
            <include name="TEST-*.xml"/>
        </fileset>
        <report format="frames" todir="${junit.output.dir}"/>
    </junitreport>
</target>

<target name="compile">
    <mkdir dir="${classes.dir}"/>
    <javac srcdir="${src.dir}" destdir="${classes.dir}" includeantruntime="false">
        <classpath>
            <path id="application" location="${jar.dir}/${ant.project.name}.jar"/>
            <path id="junit" location="${lib.dir}/junit-4.9b2.jar"/>
        </classpath>
    </javac>
</target>
</project>
4

2 回答 2

3

对于警告,请将 includeantruntime 添加到 javac 目标。请点击以下链接了解更多信息。 蚂蚁警告:“'includeantruntime' 未设置”

于 2012-06-07T20:55:52.800 回答
1

你的 Ant 版本是多少?

链接讨论 1.8.3 中的修复

于 2012-06-06T11:08:38.243 回答