Skip to content

Commit

Permalink
java: pom.xml: Add "release" profile for deploying and releasing arti…
Browse files Browse the repository at this point in the history
…facts to the OSS Sonatype repository.

From there, packages will be automatically synced to Maven Central.
  • Loading branch information
michael-berlin committed Apr 25, 2017
1 parent 599b721 commit 6c06e70
Showing 1 changed file with 82 additions and 0 deletions.
82 changes: 82 additions & 0 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,13 @@
</dependencies>
</dependencyManagement>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>

<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -235,4 +242,79 @@
</plugin>
</plugins>
</build>

<!-- "release" Profile for releasing to OSS Sonatype which syncs to Maven Central. -->
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<!-- Disable doclint in Java 8. See http://stackoverflow.com/questions/15886209/maven-is-not-working-in-java-8-when-javadoc-tags-are-incomplete.
TODO(mberlin): Remove this once we fixed all lint errors. -->
<profile>
<id>disable-java8-doclint</id>
<activation>
<jdk>[1.8,)</jdk>
</activation>
<properties>
<additionalparam>-Xdoclint:none</additionalparam>
</properties>
</profile>
</profiles>

</project>

0 comments on commit 6c06e70

Please sign in to comment.