我正在尝试创建一个ant脚本,它将为我的项目创建一个发布包。我已经开始使用Eclipse gui中的Generate Javadoc命令生成Javadoc ant脚本。
生成的脚本如下
<?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 :(得分:0)
如果您发布错误消息,那么它将会有很多帮助......
没有看到错误,这是我的建议:
1)将您的构建文件放在名为“build.xml”
的文件中2)在这个放置build.xml文件的目录中,尝试执行ant 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>
希望它有所帮助! (或者,考虑到你的帖子的日期......你在其他地方找到了解决方案)