如何使用源和JavaDoc部署SNAPSHOT? [英] How to deploy SNAPSHOT with sources and JavaDoc?

查看:106
本文介绍了如何使用源和JavaDoc部署SNAPSHOT?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用快照部署源代码和javadoc。这意味着我想自动化以下命令:

I want to deploy sources and javadocs with my snapshots. This means that I want to automize the following command:

mvn clean source:jar javadoc:jar deploy

执行:

mvn clean deploy

我不希望在<$ c期间执行javadoc / sources生成$ c> install 阶段(即本地构建)。

I don't want to have javadoc/sources generation executed during the install phase (i.e. local builds).

我知道源/ javadoc插件可以与<$的执行同步c $ c>发布插件,但我无法弄清楚如何将它连接到快照发布。

I know that source/javadoc plugins can be synchronized with the execution of the release plugin but I can't figure out how to wire it to the snapshots releases.

推荐答案

<build>
  <plugins> 
    <plugin>
      <artifactId>maven-source-plugin</artifactId>
      <executions>
        <execution>
          <id>attach-sources</id>
          <phase>deploy</phase>
          <goals><goal>jar-no-fork</goal></goals> 
        </execution>
      </executions>
    </plugin>
    <plugin> 
      <artifactId>maven-javadoc-plugin</artifactId> 
      <executions> 
        <execution> 
          <id>attach-javadocs</id>
          <phase>deploy</phase>
          <goals><goal>jar</goal></goals> 
        </execution> 
      </executions> 
    </plugin>
    <plugin> 
      <!-- explicitly define maven-deploy-plugin after other to force exec order -->
      <artifactId>maven-deploy-plugin</artifactId> 
      <executions> 
        <execution> 
          <id>deploy</id>
          <phase>deploy</phase>
          <goals><goal>deploy</goal></goals> 
        </execution> 
      </executions> 
    </plugin>
  </plugins> 
</build>

参见 Sonatype的OSS父POM 以获得完整的示例。

See Sonatype's OSS parent POM for a complete example.

这篇关于如何使用源和JavaDoc部署SNAPSHOT?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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