简体   繁体   English

在Maven中生成javadoc,然后通过scp上传?

[英]Generate javadoc in maven and then upload via scp?

I have Maven javadoc plugin working nicely right now, but I do not know how to add it to the remote directory via scp. 我的Maven javadoc插件现在可以正常工作,但是我不知道如何通过scp将其添加到远程目录。

How do I transfer the javadoc files via scp, but AFTER they have been generated? 我如何通过scp传输javadoc文件,但是在生成它们之后呢? Can this automatically happen when I call site:site? 当我致电site:site时,会自动发生吗?

Thanks! 谢谢!

maven-javadoc-plugin doesn't attach to any phase/goal by default, you need configure it manually in pom.xml. 默认情况下,maven-javadoc-plugin不会附加到任何阶段/目标,您需要在pom.xml中手动配置它。

See Generate Javadocs As Part Of Project Reports : 请参阅生成Javadocs作为项目报告的一部分

To generate javadocs as part of the site generation, you should add the Javadoc Plugin in the section of your pom: 要将Javadocs生成为网站生成的一部分,您应该在pom的部分中添加Javadoc插件:

  <project> ... <reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.8.1</version> <configuration> ... </configuration> </plugin> </plugins> ... </reporting> ... </project> 

When you execute mvn site, the javadocs will be generated and included in the generated site. 当您执行mvn网站时,将生成javadocs并将其包含在生成的网站中。 A link to the javadocs will be added in the Project Reports menu. javadocs的链接将添加到“项目报告”菜单中。


Alternatively, if you use maven-release-plugin, javadoc generation (and upload) is automatically handled by default, see here : 另外,如果您使用maven-release-plugin,则默认情况下会自动处理javadoc生成(和上传),请参见此处

The following delvierables are created and deployed to local and remoted repositories after the execution of the release:perform goal has finished. 在执行release:perform目标完成之后,将创建以下delvierables并将其部署到本地和远程存储库。

  • artifact id-version.jar 工件id-version.jar
    The binaries for the current release of the project. 当前版本的项目的二进制文件。

  • artifact id-version-javadoc.jar 工件id-version-javadoc.jar
    The javadoc explaining the current functionality of the classes within the current release. 解释当前版本中类的当前功能的javadoc。

  • artifact id-version-source.jar 工件id-version-source.jar
    The source code revisions used to build the current release of the project. 用于构建项目当前版本的源代码修订版。

  • artifact id-version.pom 工件id-version.pom
    The contents of the pom.xml file used to create the current release of the project. pom.xml文件的内容用于创建项目的当前版本。


If you want to attach javadoc generation to some phase/goal other than site, check out How to deploy Javadoc jar file? 如果要将Javadoc生成附加到站点以外的某个阶段/目标,请查看如何部署Javadoc jar文件?

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

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