蚂蚁的javadoc不建 [英] ant javadoc does not build

查看:152
本文介绍了蚂蚁的javadoc不建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的第一个Java项目部署的蚂蚁。我必须尽快提交我的code和没有时间的Hello World之类的事情了蚂蚁。我试图让我的项目一个build.xml做了一些谷歌后,但现在我坚持!

蚂蚁的javadoc不为我工作。下面是错误它显示给定的命令时:蚂蚁的javadoc -debug

 试图创建类型org.apache.tools.ant.helper.DefaultExecutor对象
添加参考:ant.executor构建失败
目标的javadoc没有项目蚂蚁测试存在。
    在org.apache.tools.ant.Project.tsort(Project.java:1912)
    在org.apache.tools.ant.Project.topoSort(Project.java:1820)
    在org.apache.tools.ant.Project.topoSort(Project.java:1783)
    在org.apache.tools.ant.Project.executeTarget(Project.java:1368)
    在org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:41)
    在org.apache.tools.ant.Project.executeTargets(Project.java:1251)
    在org.apache.tools.ant.Main.runBuild(Main.java:811)
    在org.apache.tools.ant.Main.startAnt(Main.java:217)
    在org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
    在org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)总时间:0秒

下我创建了我所有的四个类的包

 包org.acrusys.customers;

和最后但并非最下方至少是目录结构

 的C目录:\\用户\\萨尔曼\\ JavaWorkspace \\ Arcusys的\\ src \\组织\\ acrusys \\客户04/11/2012下午七点40分< D​​IR> 。
04/11/2012下午七点40分< D​​IR> ..
04/11/2012下午六时20 757 AllCustomers.class
04/11/2012下午12:22 520 AllCustomers.java
04/11/2012下午七点40分< D​​IR>建立
04/11/2012 07:30下午1746的build.xml
04/11/2012下午3时09< D​​IR>班
04/11/2012下午六时20 1470 Customer.class
04/11/2012下午5时27分1456 Customer.java
04/11/2012下午六时20 1396 CustomerFullAddress.class
04/10/2012 11:55 PM 1343 CustomerFullAddress.java
04/11/2012下午六时20 2,890 CustomerMain.class
04/11/2012下午6点19分2,392 CustomerMain.java
04/11/2012下午七点40分< D​​IR> DIST
04/11/2012下午七点40分< D​​IR>文档
04/11/2012下午6时55< D​​IR> SRC

下面是Javadoc中(我忘记了它最初贴)

 <目标名称=文档依赖=编译>
< javadoc的packagenames =。org.acrusys.customers *源路径=$ {}对于src.dirDESTDIR =$ {} docs.dir>
<! - 定义哪些文件/目录应该得到包括在内,我们包括所有 - >
<文件集DIR =$ {}对于src.dir>
<包括姓名=**/>
< /文件集>
< / javadoc的>
< /目标与GT;


解决方案

这code为我工作。我给这里只的目标,你需要使用这个目标。

 <目标名称=文档依赖=编译>
    < javadoc的packagenames =SRC源路径=$ {}对于src.dirDESTDIR =$ {} docs.dir>
      <! - 定义哪些文件/目录应该得到包括在内,我们包括所有 - >
       <文件集DIR =$ {}对于src.dir>
                <包括姓名=**/>
           < /文件集>
    < / javadoc的>
  < /目标与GT;

运行这个目标后,你会得到所有文件到您的doc文件夹。

This is my first java project deploying ant. I have to submit my code soon and do not have time for Hello World sort of thing for Ant. I tried to make a build.xml for my project after doing a bit of google but now i am stuck!

The ant javadoc does not work for me. Below is the error it displays when given the command : ant javadoc -debug

Attempting to create object of type org.apache.tools.ant.helper.DefaultExecutor
Adding reference: ant.executor

BUILD FAILED
Target "javadoc" does not exist in the project "Ant-Test".
    at org.apache.tools.ant.Project.tsort(Project.java:1912)
    at org.apache.tools.ant.Project.topoSort(Project.java:1820)
    at org.apache.tools.ant.Project.topoSort(Project.java:1783)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
    at org.apache.tools.ant.Main.runBuild(Main.java:811)
    at org.apache.tools.ant.Main.startAnt(Main.java:217)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

Total time: 0 seconds

the package under which i have created all my four classes

package org.acrusys.customers;

and last but not the least below is the directory structure

Directory of C:\Users\Salman\JavaWorkspace\Arcusys\src\org\acrusys\customers

04/11/2012  07:40 PM    <DIR>          .
04/11/2012  07:40 PM    <DIR>          ..
04/11/2012  06:20 PM               757 AllCustomers.class 
04/11/2012  12:22 PM               520 AllCustomers.java
04/11/2012  07:40 PM    <DIR>          build
04/11/2012  07:30 PM             1,746 build.xml
04/11/2012  03:09 PM    <DIR>          classes
04/11/2012  06:20 PM             1,470 Customer.class
04/11/2012  05:27 PM             1,456 Customer.java
04/11/2012  06:20 PM             1,396 CustomerFullAddress.class
04/10/2012  11:55 PM             1,343 CustomerFullAddress.java
04/11/2012  06:20 PM             2,890 CustomerMain.class
04/11/2012  06:19 PM             2,392 CustomerMain.java
04/11/2012  07:40 PM    <DIR>          dist
04/11/2012  07:40 PM    <DIR>          docs
04/11/2012  06:55 PM    <DIR>          src

Here is the Javadoc (i forget to paste it initially)

<target name="docs" depends="compile">
<javadoc packagenames="org.acrusys.customers.*" sourcepath="${src.dir}"    destdir="${docs.dir}">
<!-- Define which files / directory should get included, we include all -->
<fileset dir="${src.dir}">
<include name="**" />
</fileset>
</javadoc>
</target>

解决方案

This code is working for me. I am giving here only target you need to use this target.

<target name="docs" depends="compile">
    <javadoc packagenames="src" sourcepath="${src.dir}" destdir="${docs.dir}">
      <!-- Define which files / directory should get included, we include all -->
       <fileset dir="${src.dir}">
                <include name="**" />
           </fileset>
    </javadoc>
  </target>

After running this target you will get all documents into your doc folder.

这篇关于蚂蚁的javadoc不建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆