在Maven中生成javadoc,然后通过scp上传? [英] Generate javadoc in maven and then upload via scp?

查看:205
本文介绍了在Maven中生成javadoc,然后通过scp上传?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在使Maven javadoc插件运行良好,但是我不知道如何通过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.

我如何通过scp传输javadoc文件,但是在生成它们之后呢?当我致电site:site时,会自动发生吗?

How do I transfer the javadoc files via scp, but AFTER they have been generated? Can this automatically happen when I call site:site?

谢谢!

推荐答案

maven-javadoc-plugin默认不附加到任何阶段/目标,您需要在pom.xml中手动配置它.

maven-javadoc-plugin doesn't attach to any phase/goal by default, you need configure it manually in pom.xml.

请参见将Javadocs生成为项目报告的一部分:

要在站点生成过程中生成javadocs,应在pom部分中添加Javadoc插件:

To generate javadocs as part of the site generation, you should add the Javadoc Plugin in the section of your pom:

 <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>

当您执行mvn网站时,将生成javadocs并将其包含在生成的网站中.到javadocs的链接将添加到项目报告"菜单中.

When you execute mvn site, the javadocs will be generated and included in the generated site. A link to the javadocs will be added in the Project Reports menu.


或者,如果您使用maven-release-plugin,则默认情况下将自动处理javadoc生成(和上传),请参见

在执行release:perform目标完成之后,将创建以下delvierables并将其部署到本地和远程存储库.

The following delvierables are created and deployed to local and remoted repositories after the execution of the release:perform goal has finished.

  • 工件id-version.jar
    项目当前版本的二进制文件.

  • artifact id-version.jar
    The binaries for the current release of the project.

工件id-version-javadoc.jar
解释当前版本中类的当前功能的javadoc.

artifact id-version-javadoc.jar
The javadoc explaining the current functionality of the classes within the current release.

工件id-version-source.jar
用于构建项目当前版本的源代码修订版.

artifact id-version-source.jar
The source code revisions used to build the current release of the project.

工件id-version.pom
用于创建项目当前版本的pom.xml文件的内容.

artifact id-version.pom
The contents of the pom.xml file used to create the current release of the project.


如果要将Javadoc生成附加到站点以外的某个阶段/目标,请检出如何部署Javadoc jar文件?

这篇关于在Maven中生成javadoc,然后通过scp上传?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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