我可以在不明确命名软件包的情况下从命令行中使用Javadoc一个整个Java项目吗?

发布于 2025-01-25 10:12:21 字数 279 浏览 3 评论 0 原文

我有一个带有许多软件包的Java代码库,我不太熟悉。

我只想在While Thick上获得Javadoc-ing的概述。不必指定我要记录的包装的名称。我只想要“一切”

是否有一个简单的命令行选项?

更新:

我刚刚期望能够写一些类似的内容,

javadoc -d /home/html -sourcepath .

以获取Courtect目录下定义的所有软件包

,但似乎并没有这种方式。但是,要获得这一点是什么呢?

I have a java codebase with many packages which I'm not that familiar with.

I just want to get an overview by javadoc-ing the while thing. Without having to specify the names of which packages I want to document. I just want "everything"

Is there a simple command line option for this?

Update :

I would have just expected to be able to write something like

javadoc -d /home/html -sourcepath .

to get all the packages defined under the currect directory

But it doesn't seem to work that way. But what would be the way to get that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一花一树开 2025-02-01 10:12:21

基于GUI的答案,

一种简单而舒适的方式(需要 Intellijij ):

  1. 打开该项目。

  2. 打开工具菜单。

  3. 单击生成Javadoc ...

  4. 在Javadoc范围中,选择整个项目 radiobutton。

GUI based answer, unrelated

An easy and cozy way (requires IntelliJ):

  1. Open the project.
    IntelliJ window image

  2. Open the Tools menu.
    Image showing Menu

  3. Click on Generate JavaDoc....
    Image showing highlighted option

  4. In JavaDoc Scope, choose the Whole project radiobutton.
    Image with JavaDoc options

孤独陪着我 2025-02-01 10:12:21

并且源文件在 c:\ javaproject \ src

javaproject 中,

cd C:\JavaProject\src

如果您的项目在 c: \

javadoc -d C:\JavaProject\docs * -subpackages *

中:
如果此方法遇到不是软件包或源的子目录,则该方法将失败。
如果 src 中存在文件,或者目录是空的,如果消息错误 - 无需包装,它将失败。

这是 github repo 让您克隆并尝试一下。

If your project is in C:\JavaProject and the source files are in C:\JavaProject\src,

Use command:

cd C:\JavaProject\src

followed by:

javadoc -d C:\JavaProject\docs * -subpackages *

Warning:
This method will fail if it encounters a subdirectory that is not a package or source.
It will also fail if files are present in src or if a directory is empty with the message error - No source files for package.

Here's a GitHub repo for you to clone and try this out.

深陷 2025-02-01 10:12:21

对于 maven项目,您可以在项目目录中使用 mvn javadoc:javadoc 命令:

..\project> mvn javadoc:javadoc

但是,为此,您需要添加 maven-javadoc-plugin >在您的 pom.xml 文件中:

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.7.0</version>
        </plugin>
    </plugins>
</build>

您可以检查最新的 maven-javadoc-plugin

:://mvnrepository.com/artifact/org.apache.maven.plugins/maven-javadoc-plugin“ rel =” nofollow noreferrer“> mvnrepository \ target \ site \ apidocs \ index.html

For Maven projects, you may use mvn javadoc:javadoc command in your project directory:

..\project> mvn javadoc:javadoc

But for that, you need to add maven-javadoc-plugin to your pom.xml file:

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.7.0</version>
        </plugin>
    </plugins>
</build>

You may check the latest maven-javadoc-plugin version on mvnrepository

The javadoc can then be found on project\target\site\apidocs\index.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文