我怎样才能让一个Ant的Javadoc类排除两个文件? [英] How can I make an Ant Javadoc class exclude two files?

查看:132
本文介绍了我怎样才能让一个Ant的Javadoc类排除两个文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我记录一些Java的web服务和支持的数据类型。有迹象表明,我不希望记录两个服务。什么是排除少量文件的在Ant任务的javadoc正确的方式?

I am documenting some Java webservices and the supporting datatypes. There are two services that I do not want documented. What is the correct way to exclude a small number of files from the Ant javadoc task?

我已经在使用嵌套的源路径的文件或文件集或来源档案与包含和排除各种组合试了几个迭代。

I have tried several iterations using files or filesets nested under sourcepath or sourcefiles with various combinations of include and exclude.

我已经正确定义的基本目标文档我所有的web服务的:

The base target I have defined correctly documents all of my webservices:

    <target name="javadoc.webservices" description="Generate the documentation for companyproject webservices">
    <delete dir="docs/webservices" failonerror="true"/>
    <mkdir dir="docs/webservices"/>
    <javadoc packagenames="com.company.project.webservices,com.company.project.models.*"
             defaultexcludes="yes"
             destdir="docs/webservices"
             author="true"
             version="true"
             use="true"
             windowtitle="company project Webservices">
        <doctitle><![CDATA[<h1>company project Webservices</h1>]]></doctitle>
        <bottom><![CDATA[<i>Copyright &#169; 2011 company Corp. All Rights Reserved.</i>]]></bottom>
        <sourcepath>
            <path location="companyproject-ejb/src/java"/>
            <path location="companyproject-models/src"/>
        </sourcepath>
        <classpath>
            <path refid="companyproject-models.module.classpath"/>
            <path refid="companyproject-ejb.module.classpath"/>
            <pathelement location="${companyproject-ejb.output.dir}"/>
        </classpath>
    </javadoc>
</target>

我尝试过的一些变化包括:

Some variations I have tried include:

<sourcefiles>
            <fileset dir="companyproject-ejb/src/java">
                <include name="**/*.java"/>
                <exclude name="**/*IntegrationTestWS*, **/*NhinInterfaceWS*"/>
            </fileset>
        </sourcefiles>

此错误与的javadoc.exe CreateProcess的错误= 87,参数不正确

<sourcepath>
            <fileset dir="companyproject-ejb/src/java">
                <include name="**/*.java"/>
                <exclude name="**/*IntegrationTestWS*, **/*NhinInterfaceWS*"/>
            </fileset>
        </sourcepath>

同样的错误来源档案,但已经有很多消息说跳绳&LT的; somefile&GT;因为它是没有目录

我已经尝试使用类似的变化&LT;文件&GT; 而不是&LT;文件集的方式&gt;

I have tried similar variations using <files> instead of <fileset>.

我觉得我缺少的是如何包含/排除一些作品基本的了解。谢谢您的帮助!

I think I am missing some basic understanding of how includes/excludes works. Thank you for your help!

AlexR并没有完全得到它,但走近。我删除&LT;&源路径GT; 并添加

AlexR didn't quite get it but came close. I removed <sourcepath> and added

<fileset dir="./Companyproject-ejb/src/java/">
<include name="com/Company/project/webservices/*"/>
<exclude name="**/IntegrationTestWS*"/>
<exclude name="**/NhinInterfaceWS*"/>
</fileset>
<packageset dir="./Companyproject-models/src/">
    <include name="com/Company/project/models/**"/>
</packageset>

由于只有一个文件集导致的javadoc抱怨它找不到任何软件包。 PACKAGESET行为类似dirset,所以不能排除单一文件,仅目录。在这种情况下,我能够定义一个PACKAGESET为一组DOCO和文件集的限制集合,并围绕它得到的。

Having only a fileset led javadoc to complain that it couldn't find any packages. Packageset behaves like a dirset, so it can't exclude single files, only directories. In this case I was able to define a packageset for one set of doco and a fileset for the restricted set and get around it.

推荐答案

<fileset dir="src" defaultexcludes="yes">
  <include name="com/dummy/test/**"/>
  <exclude name="com/dummy/test/doc-files/**"/>
</fileset>

..................

..................

我认为你的错误是来源档案和源路径标签。尝试将其删除。
欲了解更多信息,看看这里: http://ant.apache.org/manual/Tasks /javadoc.html

I think that your mistake is the "sourcefiles" and "sourcepath" tags. Try to remove them. For more information take a look here: http://ant.apache.org/manual/Tasks/javadoc.html

祝你好运!

这篇关于我怎样才能让一个Ant的Javadoc类排除两个文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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