展开全部
运行ant命令时指定-logfile参数,例如:
ant -f build.xml -logfile release.log
ant -f build.xml -logfile release.log
追问
这是将信息输出到文本中而已啊,我这样做过,他也只输出了100条记录!有什么方法能将其全部输出呢
追答
1、-logfile参数是ant的选项,输出的内容由ant控制,正常来讲应该是全部输出,除非编译的过程中出现错误,其他情况我还没有遇到。
2、可以采用重定向控制台输出到文件中。
3、设置javac的参数-Xstdout filename,将编译信息写入指定文件。
4、这个不是推荐的了,不错你也可以试试,那就是在命令行窗口的属性对话框中设置缓冲区大小了。
参考资料: http://hi.baidu.com/%D3%E3%B5%C4%C6%F4%CA%BE%C2%BC/blog/item/ec9cad18300d8c0b35fa418f.html
2011-04-02
展开全部
t name="build" description="Compile main source tree java files">
<mkdir dir="$"/>
<javac destdir="$" source="1.5" target="1.5" debug="true"
deprecation="false" optimize="false" failonerror="true">
<src path="$"/>
<classpath refid="master-classpath"/>
</javac>
</target>
给你一个建议,ant的具体用法是不需要太深入的了解,会读会用会改会copy,就能基本应付工作中所有问题了。我以前还是自己写ant,到后来发现没什么必要,现在用的ant就是从hibernate中帮助文档里找来的,功能很全面,常用的都有了。
<?xml version="1.0"?>
<project name="springmvc" basedir="." default="usage">
<property file="build.properties"/>
<property name="src.dir" value="src"/>
<property name="web.dir" value="war"/>
<property name="build.dir" value="$/WEB-INF/classes"/>
<property name="name" value="springmvc"/>
<path id="master-classpath">
<fileset dir="$/WEB-INF/lib">
<include name="*.jar"/>
</fileset>
<!-- We need the servlet API classes: -->
<!-- * for Tomcat 5/6 use servlet-api.jar -->
<!-- * for other app servers - check the docs -->
<fileset dir="$">
<include name="servlet*.jar"/>
</fileset>
<pathelement path="$"/>
</path>
<target name="usage">
<echo message=""/>
<echo message="$ build file"/>
<echo message="-----------------------------------"/>
<echo message=""/>
<echo message="Available targets are:"/>
<echo message=""/>
<echo message="build --> Build the application"/>
<echo message="deploy --> Deploy application as directory"/>
<echo message="deploywar --> Deploy application as a WAR file"/>
<echo message="install --> Install application in Tomcat"/>
<echo message="reload --> Reload application in Tomcat"/>
<echo message="start --> Start Tomcat application"/>
<echo message="stop --> Stop Tomcat application"/>
<echo message="list --> List Tomcat applications"/>
<echo message=""/>
</target>
<target name="build" description="Compile main source tree java files">
<mkdir dir="$"/>
<javac destdir="$" source="1.5" target="1.5" debug="true"
deprecation="false" optimize="false" failonerror="true">
<src path="$"/>
<classpath refid="master-classpath"/>
</javac>
</target>
<target name="deploy" depends="build" description="Deploy application">
<copy todir="$/$" preservelastmodified="true">
<fileset dir="$">
<include name="**/*.*"/>
</fileset>
</copy>
</target>
<target name="deploywar" depends="build" description="Deploy application as a WAR file">
<war destfile="$.war"
webxml="$/WEB-INF/web.xml">
<fileset dir="$">
<include name="**/*.*"/>
</fileset>
</war>
<copy todir="$" preservelastmodified="true">
<fileset dir=".">
<include name="*.war"/>
</fileset>
</copy>
</target>
<!-- ============================================================== -->
<!-- Tomcat tasks - remove these if you don't have Tomcat installed -->
<!-- ============================================================== -->
<path id="catalina-ant-classpath">
<!-- We need the Catalina jars for Tomcat -->
<!-- * for other app servers - check the docs -->
<fileset dir="$">
<include name="catalina-ant.jar"/>
</fileset>
</path>
<taskdef name="install" classname="org.apache.catalina.ant.InstallTask">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<taskdef name="list" classname="org.apache.catalina.ant.ListTask">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<taskdef name="start" classname="org.apache.catalina.ant.StartTask">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<taskdef name="stop" classname="org.apache.catalina.ant.StopTask">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<target name="install" description="Install application in Tomcat">
<install url="$"
username="$"
password="$"
path="/$"
war="$"/>
</target>
<target name="reload" description="Reload application in Tomcat">
<reload url="$"
username="$"
password="$"
path="/$"/>
</target>
<target name="start" description="Start Tomcat application">
<start url="$"
username="$"
password="$"
path="/$"/>
</target>
<target name="stop" description="Stop Tomcat application">
<stop url="$"
username="$"
password="$"
path="/$"/>
</target>
<target name="list" description="List Tomcat applications">
<list url="$"
username="$"
password="$"/>
</target>
<!-- End Tomcat tasks -->
<property name="test.dir" value="test"/>
<target name="buildtests" description="Compile test tree java files">
<mkdir dir="$"/>
<javac destdir="$" source="1.5" target="1.5" debug="true"
deprecation="false" optimize="false" failonerror="true">
<src path="$"/>
<classpath refid="master-classpath"/>
</javac>
</target>
<target name="tests" depends="build, buildtests" description="Run tests">
<junit printsummary="on"
fork="false"
haltonfailure="false"
failureproperty="tests.failed"
showoutput="true">
<classpath refid="master-classpath"/>
<formatter type="brief" usefile="false"/>
<batchtest>
<fileset dir="$">
<include name="**/*Tests.*"/>
</fileset>
</batchtest>
</junit>
<fail if="tests.failed">
tests.failed=$
***********************************************************
***********************************************************
**** One or more tests failed! Check the output ... ****
***********************************************************
***********************************************************
</fail>
</target>
<!-- clean -->
<target name="clean" description="Clean output directories">
<delete>
<fileset dir="$">
<include name="**/*.class"/>
</fileset>
</delete>
</target>
<target name="undeploy" description="Un-Deploy application">
<delete>
<fileset dir="$/$">
<include name="**/*.*"/>
</fileset>
</delete>
</target>
</project>
另外,站长团上有产品团购,便宜有保证
<mkdir dir="$"/>
<javac destdir="$" source="1.5" target="1.5" debug="true"
deprecation="false" optimize="false" failonerror="true">
<src path="$"/>
<classpath refid="master-classpath"/>
</javac>
</target>
给你一个建议,ant的具体用法是不需要太深入的了解,会读会用会改会copy,就能基本应付工作中所有问题了。我以前还是自己写ant,到后来发现没什么必要,现在用的ant就是从hibernate中帮助文档里找来的,功能很全面,常用的都有了。
<?xml version="1.0"?>
<project name="springmvc" basedir="." default="usage">
<property file="build.properties"/>
<property name="src.dir" value="src"/>
<property name="web.dir" value="war"/>
<property name="build.dir" value="$/WEB-INF/classes"/>
<property name="name" value="springmvc"/>
<path id="master-classpath">
<fileset dir="$/WEB-INF/lib">
<include name="*.jar"/>
</fileset>
<!-- We need the servlet API classes: -->
<!-- * for Tomcat 5/6 use servlet-api.jar -->
<!-- * for other app servers - check the docs -->
<fileset dir="$">
<include name="servlet*.jar"/>
</fileset>
<pathelement path="$"/>
</path>
<target name="usage">
<echo message=""/>
<echo message="$ build file"/>
<echo message="-----------------------------------"/>
<echo message=""/>
<echo message="Available targets are:"/>
<echo message=""/>
<echo message="build --> Build the application"/>
<echo message="deploy --> Deploy application as directory"/>
<echo message="deploywar --> Deploy application as a WAR file"/>
<echo message="install --> Install application in Tomcat"/>
<echo message="reload --> Reload application in Tomcat"/>
<echo message="start --> Start Tomcat application"/>
<echo message="stop --> Stop Tomcat application"/>
<echo message="list --> List Tomcat applications"/>
<echo message=""/>
</target>
<target name="build" description="Compile main source tree java files">
<mkdir dir="$"/>
<javac destdir="$" source="1.5" target="1.5" debug="true"
deprecation="false" optimize="false" failonerror="true">
<src path="$"/>
<classpath refid="master-classpath"/>
</javac>
</target>
<target name="deploy" depends="build" description="Deploy application">
<copy todir="$/$" preservelastmodified="true">
<fileset dir="$">
<include name="**/*.*"/>
</fileset>
</copy>
</target>
<target name="deploywar" depends="build" description="Deploy application as a WAR file">
<war destfile="$.war"
webxml="$/WEB-INF/web.xml">
<fileset dir="$">
<include name="**/*.*"/>
</fileset>
</war>
<copy todir="$" preservelastmodified="true">
<fileset dir=".">
<include name="*.war"/>
</fileset>
</copy>
</target>
<!-- ============================================================== -->
<!-- Tomcat tasks - remove these if you don't have Tomcat installed -->
<!-- ============================================================== -->
<path id="catalina-ant-classpath">
<!-- We need the Catalina jars for Tomcat -->
<!-- * for other app servers - check the docs -->
<fileset dir="$">
<include name="catalina-ant.jar"/>
</fileset>
</path>
<taskdef name="install" classname="org.apache.catalina.ant.InstallTask">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<taskdef name="list" classname="org.apache.catalina.ant.ListTask">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<taskdef name="start" classname="org.apache.catalina.ant.StartTask">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<taskdef name="stop" classname="org.apache.catalina.ant.StopTask">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<target name="install" description="Install application in Tomcat">
<install url="$"
username="$"
password="$"
path="/$"
war="$"/>
</target>
<target name="reload" description="Reload application in Tomcat">
<reload url="$"
username="$"
password="$"
path="/$"/>
</target>
<target name="start" description="Start Tomcat application">
<start url="$"
username="$"
password="$"
path="/$"/>
</target>
<target name="stop" description="Stop Tomcat application">
<stop url="$"
username="$"
password="$"
path="/$"/>
</target>
<target name="list" description="List Tomcat applications">
<list url="$"
username="$"
password="$"/>
</target>
<!-- End Tomcat tasks -->
<property name="test.dir" value="test"/>
<target name="buildtests" description="Compile test tree java files">
<mkdir dir="$"/>
<javac destdir="$" source="1.5" target="1.5" debug="true"
deprecation="false" optimize="false" failonerror="true">
<src path="$"/>
<classpath refid="master-classpath"/>
</javac>
</target>
<target name="tests" depends="build, buildtests" description="Run tests">
<junit printsummary="on"
fork="false"
haltonfailure="false"
failureproperty="tests.failed"
showoutput="true">
<classpath refid="master-classpath"/>
<formatter type="brief" usefile="false"/>
<batchtest>
<fileset dir="$">
<include name="**/*Tests.*"/>
</fileset>
</batchtest>
</junit>
<fail if="tests.failed">
tests.failed=$
***********************************************************
***********************************************************
**** One or more tests failed! Check the output ... ****
***********************************************************
***********************************************************
</fail>
</target>
<!-- clean -->
<target name="clean" description="Clean output directories">
<delete>
<fileset dir="$">
<include name="**/*.class"/>
</fileset>
</delete>
</target>
<target name="undeploy" description="Un-Deploy application">
<delete>
<fileset dir="$/$">
<include name="**/*.*"/>
</fileset>
</delete>
</target>
</project>
另外,站长团上有产品团购,便宜有保证
追问
在我们项目中有都是从svn上下载代码,系统之间会有相互的jar包调用,自动换jar包实现比较麻烦。用ant主要实现升级补丁,上传服务器后重启服务器的WebLogic比较恶心,就是将后台信息定位到nohup中还没有实现。请问高手知道吗?我看来网上的很多但是还是不能实现输入&,请指教,谢谢啊
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |