ant javadoc 不构建 [英] ant javadoc does not build

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

问题描述

这是我第一个部署ant的java项目.我必须尽快提交我的代码并且没有时间为 Ant 做 Hello World 之类的事情.在做了一些谷歌之后,我试图为我的项目制作一个 build.xml,但现在我被卡住了!

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!

ant javadoc 对我不起作用.以下是给出命令时显示的错误:ant javadoc -debug

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

这是Javadoc(我一开始忘记粘贴了)

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>

运行此目标后,您会将所有文档放入 doc 文件夹.

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

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

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