Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
197 views
in Technique[技术] by (71.8m points)

java - How to deploy SNAPSHOT with sources and 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

Just to execute:

mvn clean deploy

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

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
<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>

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...