Maven:如何从javadoc中排除特定的源文件? [英] Maven: How do I exclude specific source files from javadoc?

查看:444
本文介绍了Maven:如何从javadoc中排除特定的源文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用Maven从Javadoc中排除特定的源文件(不仅仅是软件包). < excludePackageNames>设置对我不起作用:它仅允许您排除某些软件包.有一个< sourceFileExcludes>使用示例中基本上没有文档的设置.它只是说:

I need to exclude specific source files (NOT just packages) from Javadoc using Maven. The <excludePackageNames> setting will not work for me: it only allows you to exclude certain packages. There's a <sourceFileExcludes> setting that has basically no documentation in the way of usage examples. It just says:

"sourceFileExcludes:排除源文件上的过滤器.如果指定子包或排除子包,则将忽略这些过滤器."

"sourceFileExcludes: exclude filters on the source files. These are ignored if you specify subpackages or subpackage excludes."

因此,基本上,我需要忽略所有以Mock开头的Java文件,以及两个软件包中的所有Java文件.如果我指定excludePackageNames,则将忽略sourceFileExcludes,因此无法合并它们.所以我尝试了这个:

So, basically, I need to ignore all Java files that start with Mock, and also all Java files in two packages. Since sourceFileExcludes are ignored if I specify excludePackageNames, I can't combine them. So I tried this:

<sourceFileExcludes>
    <exclude>net/my/packagename/mock</exclude>
    <exclude>net/my/packagename/samples</exclude>
    <exclude>**/Mock*.java</exclude>
</sourceFileExcludes>

但是它没有用.没有排除任何预期的文件.

But it did not work. None of the intended files were excluded.

有人知道如何使用sourceFileExcludes吗?

Anybody know how to use sourceFileExcludes?

推荐答案

目前可能无法正常工作.插件问题跟踪器中记录了一个错误- MJAVADOC-365

It might just not be working at the moment. There is bug logged in the plugin issue tracker - MJAVADOC-365

这篇关于Maven:如何从javadoc中排除特定的源文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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