简体   繁体   中英

how to exclude files on javadoc ant script

How can I make an Ant Javadoc class exclude two files?

Excluding some source files from javadoc generation using ANT

I get the same problem, but i didn't solve it yet... I've tried some of these solutions, but no one worked for me.

my code:

<target name="javadocs">
<mkdir dir="${docs.dir}" />
<fileset dir="${project.dir}\src" defaultexcludes="yes">
  <exclude name=".externalToolBuilders\**"/>
</fileset>
<javadoc 
    excludepackagenames=".externalToolBuilders\**"
    sourcepath="${project.dir}" 
    destdir="${docs.dir}" 
    classpath="${project.dir}" 
    author="true" version="true" 
    use="true" 
    doctitle="&lt;h1&gt;${app.name}&lt;/h1&gt;" />

EDIT-1:

after I tried this:

<javadoc 
sourcepath="${project.dir}" 
destdir="${docs.dir}" 
classpath="${project.dir}" 
author="true" version="true" 
use="true" >            
<fileset dir="${project.dir}\src" defaultexcludes="yes">
  <include name="**/*.java"/>
  <exclude name=".externalToolBuilders/**"/>
</fileset>
</javadoc>

I got this error:

javadocs:
[javadoc] Generating Javadoc
[javadoc] Javadoc execution
[javadoc] Loading source file D:\Paul\PaulHostIP\src\AutofitTableColumns.java...
[javadoc] javadoc: error - Illegal package name: ".externalToolBuilders.one-jar-ant-task-0.97.ant.com.simontuffs.onejar.ant"
[javadoc] Loading source file D:\Paul\PaulHostIP\src\CToolTip.java...
[javadoc] javadoc: error - Illegal package name: ".externalToolBuilders.one-jar-ant-task-0.97.test.com.simontuffs.onejar.test"
[javadoc] Loading source file D:\Paul\PaulHostIP\src\HostIP.java...
[javadoc] Loading source file D:\Paul\PaulHostIP\src\Run.java...
[javadoc] Loading source file D:\Paul\PaulHostIP\src\TableColumnSynchronizer.java...
[javadoc] Loading source file D:\Paul\PaulHostIP\src\ThreadDoSomething.java...
[javadoc] Loading source file D:\Paul\PaulHostIP\src\Work.java...
[javadoc] Loading source files for package src...
[javadoc] 2 errors

you can do it in this way:

<javadoc 
    destdir="${docs.dir}" 
    author="true" version="true" 
    use="true" 
    doctitle="Test" >
    <fileset dir="${project.dir}/src" defaultexcludes="yes">
         <include name="**/*.java"/>
         <exclude name=".externalToolBuilders/**"/>
    </fileset>
</javadoc>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM