简体   繁体   English

如何防止某些类的Java文档创建

[英]How to prevent java-doc creation for certain classes

I'm executing the following command while build generation to generate java-docs on the go 我在生成生成时执行以下命令以随时随地生成java-docs

javadoc -private <sourcepath>/*.java -d<destination directory>

Now I want to exclude certain classes from available in the source-path directory to not get included in the javadoc generation. 现在,我想从source-path目录中的某些类中排除某些类,以使其不包含在javadoc生成中。

I could see that javadoc provides an inline command "excludepackagenames" which might be useful when there are one or two files needs to be excluded. 我可以看到javadoc提供了一个内联命令“ excludepackagenames”,当需要排除一个或两个文件时,该命令可能很有用。 Now that I want to exclude 10 to 20 files, i would not want the executable command to be very long. 现在,我要排除10到20个文件,我不希望可执行命令很长。

Is there any efficient way to exclude these class either via a spring annotation or by an xml entry? 是否有任何有效的方法通过spring注释或xml条目来排​​除这些类?

You can exclude package(s) by using -exclude option: 您可以使用-exclude选项排除软件包

-exclude packagename1:packagename2:... Unconditionally excludes the specified packages and their subpackages from the list formed by -subpackages. -exclude packagename1:packagename2:...从-subpackages形成的列表中无条件排除指定的软件包及其子软件包。 It excludes those packages even if they would otherwise be included by some previous or later -subpackages option. 即使这些软件包之前或之后的-subpackages选项会另外包含这些软件包,也会将其排除在外。 For example: 例如:

 C:> javadoc -sourcepath C:\\user\\src -subpackages java -exclude java.net:java.lang 

would include java.io, java.util, and java.math (among others), but would exclude packages rooted at java.net and java.lang. 将包括java.io,java.util和java.math(以及其他),但将排除以java.net和java.lang为根的软件包。 Notice this excludes java.lang.ref, a subpackage of java.lang). 请注意,这不包括java.lang.ref(java.lang的子包)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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