简体   繁体   English

如何将项目的Java文档发布到github?

[英]How to release a Java Doc of a Project to github?

I want to release a project on Github.我想在 Github 上发布一个项目。 It works and I can retrieve it as dependency via Gradle.它可以工作,我可以通过 Gradle 将其作为依赖项检索。 But the JavaDoc is missing.但是缺少 JavaDoc。

Message:信息:

Note: This element neither has attached source nor attached Javadoc and hence no Javadoc could be found.注意:该元素既没有附加源也没有附加 Javadoc,因此找不到 Javadoc。

Do i need to build a JAR?我需要构建 JAR 吗? Or is there any way to add my JavaDoc to the Project, so JavaDoc is availiable when it is build with gradle?或者有什么方法可以将我的 JavaDoc 添加到项目中,以便使用 gradle 构建 JavaDoc?

Do not release JavaDoc to (a) Github (repository), because JavaDoc is derivation products from Java source code.不要将 JavaDoc 发布到 (a) Github(存储库),因为 JavaDoc 是 Java 源代码的派生产品。

Let's thinking, when you change comment in JavaDocs, your JavaDocs Github repository also need changing.让我们想一想,当您更改 JavaDocs 中的注释时,您的 JavaDocs Github 存储库也需要更改。 It is redundancy.这是冗余。

Let 's see few well-known Java projects on Github, such as, https://github.com/spring-projects/spring-boot , they don't put any JavaDoc (HTML files) in a GitHub repository. Let 's see few well-known Java projects on Github, such as, https://github.com/spring-projects/spring-boot , they don't put any JavaDoc (HTML files) in a GitHub repository.

Task generate JavaDocs by Gradle: https://docs.gradle.org/current/dsl/org.gradle.api.tasks.javadoc.Javadoc.html Task generate JavaDocs by Gradle: https://docs.gradle.org/current/dsl/org.gradle.api.tasks.javadoc.Javadoc.html

You could use the docs/ folder or the gh-pages branch in order to publish your generated JavaDoc on GitHub.您可以使用docs/文件夹或gh-pages分支在 GitHub 上发布您生成的 JavaDoc。

Example: ebourg.github.io/jsign/apidocs/ from github.com/ebourg/jsign/tree/gh-pages .示例:来自github.com/ebourg/jsign/tree/gh-pagesgithub.com/ebourg/jsign/tree/gh-pages

The alternative is to publish your deliverables (jars and javadoc.jar) to a binary referentials ( Central Maven or Bintray ) and let a third party service exposes the Javadoc for you.另一种方法是将您的可交付成果(jar 和 javadoc.jar)发布到二进制引用( Central MavenBintray ),并让第三方服务为您公开 Javadoc。
See " www.javadoc.io "参见“ www.javadoc.io

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

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