CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
不看会后悔的Windows XP之经验谈 简单快捷DIY实用家庭影院
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  Java >  J2EE / EJB / JMS

关于ANT自动生成JAVADOC的问题。

楼主mascotzhuang(基督山伯爵)2005-07-21 09:40:52 在 Java / J2EE / EJB / JMS 提问

ANT一段脚本中,有一段这样的脚本,如果把下面这段脚本去掉,则整个脚本就能通过,并能顺利生成JAVADOC。但是加上,就会报错。报错看下面,这是什么原因?  
  <!--   测试   -->  
  <target   name="test"   depends="compile"   description="run   junit   test">  
  <mkdir   dir="${report.dir}"/>  
  <junit   printsummary="on"   haltonfailure="false"   failureproperty="tests.failed"   showoutput="true">  
  <classpath   refid="master-classpath"   />  
  <formatter   type="plain"/>  
  <batchtest   todir="${report.dir}">  
  <fileset   dir="${classes.dir}">  
  <include   name="**/*Test.*"/>  
  </fileset>  
  </batchtest>  
  </junit>  
  <fail   if="tests.failed">  
  ********************************  
  ****   One   or   more   tests   failed!    
          Check   the   output   ...   ****  
  ********************************  
  </fail>  
  </target>  
   
   
   
   
   
  错误提示:  
   
   
  BUILD   FAILED:   D:\eclipse\workspacedi\test\build.xml:32:   Could   not   create   task   or   type   of   type:   junit.  
   
  Ant   could   not   find   the   task   or   a   class   this   task   relies   upon.  
   
  This   is   common   and   has   a   number   of   causes;   the   usual    
  solutions   are   to   read   the   manual   pages   then   download   and  
  install   needed   JAR   files,   or   fix   the   build   file:    
    -   You   have   misspelt   'junit'.  
        Fix:   check   your   spelling.  
    -   The   task   needs   an   external   JAR   file   to   execute  
            and   this   is   not   found   at   the   right   place   in   the   classpath.  
        Fix:   check   the   documentation   for   dependencies.  
        Fix:   declare   the   task.  
    -   The   task   is   an   Ant   optional   task   and   the   JAR   file   and/or   libraries  
            implementing   the   functionality   were   not   found   at   the   time   you  
            yourself   built   your   installation   of   Ant   from   the   Ant   sources.  
        Fix:   Look   in   the   ANT_HOME/lib   for   the   'ant-'   JAR   corresponding   to   the  
            task   and   make   sure   it   contains   more   than   merely   a   META-INF/MANIFEST.MF.  
            If   all   it   contains   is   the   manifest,   then   rebuild   Ant   with   the   needed  
            libraries   present   in   ${ant.home}/lib/optional/   ,   or   alternatively,  
            download   a   pre-built   release   version   from   apache.org  
    -   The   build   file   was   written   for   a   later   version   of   Ant  
        Fix:   upgrade   to   at   least   the   latest   release   version   of   Ant  
    -   The   task   is   not   an   Ant   core   or   optional   task    
            and   needs   to   be   declared   using   <taskdef>.  
    -   You   are   attempting   to   use   a   task   defined   using    
          <presetdef>   or   <macrodef>   but   have   spelt   wrong   or   not    
        defined   it   at   the   point   of   use  
   
  Remember   that   for   JAR   files   to   be   visible   to   Ant   tasks   implemented  
  in   ANT_HOME/lib,   the   files   must   be   in   the   same   directory   or   on   the  
  classpath  
   
  Please   neither   file   bug   reports   on   this   problem,   nor   email   the  
  Ant   mailing   lists,   until   all   of   these   causes   have   been   explored,  
  as   this   is   not   an   Ant   bug. 问题点数:100、回复次数:6Top

1 楼DanielYWoo(绿色毒汁)回复于 2005-07-21 10:02:53 得分 50

你的ant没有junit的扩展task吧,这个扩展task需要安装,你到www.junit.org看看  
   
  http://ant.apache.org/manual/OptionalTasks/junit.htmlTop

2 楼mascotzhuang(基督山伯爵)回复于 2005-07-21 11:21:20 得分 0

按照上面的提示已经加进了JUNIT.JAR这个包。但还是提示原来的错误。Top

3 楼DanielYWoo(绿色毒汁)回复于 2005-07-21 12:44:05 得分 10

可能还是你的classpath的问题,再仔细查查Top

4 楼hygx(失身志不移)(http://91in.blogchina.com)回复于 2005-07-21 13:04:05 得分 0

gzTop

5 楼CAYU(中原)回复于 2005-07-21 13:25:28 得分 40

junit   没有找到   在   classpathTop

6 楼mascotzhuang(基督山伯爵)回复于 2005-07-21 13:42:23 得分 0

<classpath   refid="master-classpath"   />  
  这里定义里的确有JUNIT.JARTop

相关问题

  • 在ecslipse中用ant编译,生成javadoc有问题,请指点
  • 用过JCreator的高手们,怎样使用JCreator自动生成Javadoc文档呢?
  • 自动生成textbox控件!!!
  • 自动生成序列号
  • hibernate 代码自动生成
  • 如何自动生成Html
  • 自动生成问题?
  • Eclipse 3.1如何生成javadoc文档?
  • 自动生成目录前如何设置生成目录项?
  • 如何用ANT生成jar文件

关键词

  • ant
  • 脚本
  • junit
  • check
  • task
  • fix
  • jar
  • build

得分解答快速导航

  • 帖主:mascotzhuang
  • DanielYWoo
  • DanielYWoo
  • CAYU

相关链接

  • CSDN Java频道
  • Java类图书
  • Java类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo