这是我第一个部署 ant 的 java 项目。我必须尽快提交我的代码,并且没有时间为 Ant 做 Hello World 之类的事情。在做了一些谷歌之后,我试图为我的项目制作一个 build.xml,但现在我被卡住了!
ant javadoc 对我不起作用。以下是给出命令时显示的错误: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
我创建了所有四个类的包
package org.acrusys.customers;
最后但并非最不重要的是目录结构
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(我最初忘记粘贴它)
<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>