2013-11-20 48 views
1

我想制作一个ant脚本,它将为我的项目创建一个发行包。我已经开始在Eclipse gui中使用Generate Javadoc命令生成一个Javadoc ant脚本。从Eclipse创建的蚂蚁脚本生成Javadoc

生成的脚本如下

<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
<project default="javadoc"> 
<target name="javadoc"> 
    <javadoc access="protected" author="true" classpath="C:\Eclipse\workspace\JetstreamSDK-Java\JetstreamSDK-Java\resources\libraries\jaxb-2.2.7\lib\jaxb-impl.jar;C:\Eclipse\workspace\JetstreamSDK-Java\JetstreamSDK-Java\resources\libraries\httpcomponents-client-4.2.5\lib\httpclient-4.2.5.jar;C:\Eclipse\workspace\JetstreamSDK-Java\JetstreamSDK-Java\resources\libraries\httpcomponents-client-4.2.5\lib\commons-codec-1.6.jar;C:\Eclipse\workspace\JetstreamSDK-Java\JetstreamSDK-Java\resources\libraries\jaxb-2.2.7\lib\jaxb-xjc.jar;C:\Eclipse\workspace\JetstreamSDK-Java\JetstreamSDK-Java\resources\libraries\jaxb-2.2.7\lib\jaxb-api.jar;C:\Eclipse\workspace\JetstreamSDK-Java\JetstreamSDK-Java\resources\libraries\jaxb-2.2.7\lib\jaxb-core.jar;C:\Eclipse\workspace\JetstreamSDK-Java\JetstreamSDK-Java\resources\libraries\httpcomponents-client-4.2.5\lib\httpcore-4.2.4.jar;C:\Eclipse\workspace\JetstreamSDK-Java\JetstreamSDK-Java\resources\libraries\httpcomponents-client-4.2.5\lib\commons-logging-1.1.1.jar;C:\Eclipse\workspace\JetstreamSDK-Java\JetstreamSDK-Java\resources\libraries\commons-configuration-1.9\commons-configuration-1.9.jar;C:\Eclipse\workspace\JetstreamSDK-Java\JetstreamSDK-Java\resources\libraries\jaxb-2.2.7\lib\jaxb-jxc.jar;C:\Eclipse\workspace\JetstreamSDK-Java\JetstreamSDK-Java\resources\libraries\commons-lang-2.6\commons-lang-2.6.jar" destdir="C:\Users\jender\Desktop\javadoc" nodeprecated="false" nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false" packagenames="com.TersoSolutions.Jetstream.SDK.XML.Events.LogicalDeviceAddedEvent,com.TersoSolutions.Jetstream.SDK.XML.Model.GetConfigurationResponse,com.TersoSolutions.Jetstream.SDK.XML.Model.ConfigureResponse,com.TersoSolutions.Jetstream.SDK.XML.Events.ObjectEvent,com.TersoSolutions.Jetstream.SDK.XML.Events.CommandQueuedEvent,com.TersoSolutions.Jetstream.SDK.XML.Model.CommandResponse,com.TersoSolutions.Jetstream.SDK.Application.User.DeviceSpecificCommands.TS,com.TersoSolutions.Jetstream.SDK.XML,com.TersoSolutions.Jetstream.SDK.Application.User,com.TersoSolutions.Jetstream.SDK.Application.Events,com.TersoSolutions.Jetstream.SDK.XML.Events.SensorReadingEvent,com.TersoSolutions.Jetstream.SDK.XML.Events.DeviceFailureEvent,com.TersoSolutions.Jetstream.SDK.XML.Model.RemoveEventsResponse,com.TersoSolutions.Jetstream.SDK.XML.Events.HeartbeatEvent,com.TersoSolutions.Jetstream.SDK.XML.Model.GetDeviceDefinitionsResponse,com.TersoSolutions.Jetstream.SDK.XML.Events.LogicalDeviceRemovedEvent,com.TersoSolutions.Jetstream.SDK.XML.Events.CommandCompletionEvent,com.TersoSolutions.Jetstream.SDK.XML.Events.LogEntryEvent,com.TersoSolutions.Jetstream.SDK.Application,com.TersoSolutions.Jetstream.SDK.XML.Events.DeviceRestoreEvent,com.TersoSolutions.Jetstream.SDK.XML.Model.GetPoliciesResponse,com.TersoSolutions.Jetstream.SDK.XML.Model.GetEventsResponse,com.TersoSolutions.Jetstream.SDK.XML.Events.AggregateEvent" source="1.7" sourcepath="C:\Eclipse\workspace\JetstreamSDK-Java\JetstreamSDK-Java\src" splitindex="true" use="true" version="true"/> 
</target> 
</project> 

向前发展,我决定测试脚本之前,但我不能让它正常运行。我试图用下面的命令

ant javadoc -buildfile javadoc_protected.xml 

ant javadoc -buildfile javadoc_protected.xml C:\Program Files\Java\jdk1.7.0_25\bin\javadoc.exe 

ant javadoc -buildfile javadoc_protected.xml "C:\Program Files\Java\jdk1.7.0_25\bin\javadoc.exe" 

和上面后运行的脚本没有工作,我读通过http://ant.apache.org/manual/Tasks/javadoc.html页面,并试图

ant javadoc -buildfile javadoc_protected.xml -executable C:\Program Files\Java\jdk1.7.0_25\bin\javadoc.exe 

,但我仍然没有运气。我对蚂蚁极其缺乏经验,如果有人能解释我做错了什么,我将不胜感激。

回答

0

如果你发布你得到它会帮助很多错误信息......

没有见过的错误,这是我的建议:

1)把你的构建文件中一个名为“build.xml文件”

2)在该目录中,你把build.xml文件,请尝试执行蚂蚁的Javadoc(在命令窗口 - 开始菜单,执行,CMD-)

3)如果你是得到一个错误消息说“无法运行程序javadoc.exe”,那么你哈哈在系统的路径中输入javadoc.exe。因此,在JDK添加到路径(假设你使用的是Windows操作系统),你需要打开一个命令行窗口,键入

set Path="C:\Program Files\Java\jdk1.7.0_25\bin";%Path% 

不要忘了引号!

4)执行

ant javadoc 
build.xml文件的目录中

,仅此而已!

这是一个简单的build.xml我已经习惯了测试:

<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
<project default="javadoc"> 
<target name="javadoc"> 
    <javadoc access="protected" author="true" sourcepath="C:\workspace\ZeSwing\src" destdir="C:\workspace\ZeSwing\docs"/> 
</target> 
</project> 

希望它能帮助! (或者,也许,考虑到你的帖子的日期......你已经在其他地方找到了解决方案)