Skip to content

Commit 6c06e70

Browse files
java: pom.xml: Add "release" profile for deploying and releasing artifacts to the OSS Sonatype repository.
From there, packages will be automatically synced to Maven Central.
1 parent 599b721 commit 6c06e70

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

java/pom.xml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,13 @@
205205
</dependencies>
206206
</dependencyManagement>
207207

208+
<distributionManagement>
209+
<snapshotRepository>
210+
<id>ossrh</id>
211+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
212+
</snapshotRepository>
213+
</distributionManagement>
214+
208215
<build>
209216
<plugins>
210217
<plugin>
@@ -235,4 +242,79 @@
235242
</plugin>
236243
</plugins>
237244
</build>
245+
246+
<!-- "release" Profile for releasing to OSS Sonatype which syncs to Maven Central. -->
247+
<profiles>
248+
<profile>
249+
<id>release</id>
250+
<build>
251+
<plugins>
252+
<plugin>
253+
<groupId>org.sonatype.plugins</groupId>
254+
<artifactId>nexus-staging-maven-plugin</artifactId>
255+
<version>1.6.7</version>
256+
<extensions>true</extensions>
257+
<configuration>
258+
<serverId>ossrh</serverId>
259+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
260+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
261+
</configuration>
262+
</plugin>
263+
<plugin>
264+
<groupId>org.apache.maven.plugins</groupId>
265+
<artifactId>maven-source-plugin</artifactId>
266+
<version>2.2.1</version>
267+
<executions>
268+
<execution>
269+
<id>attach-sources</id>
270+
<goals>
271+
<goal>jar-no-fork</goal>
272+
</goals>
273+
</execution>
274+
</executions>
275+
</plugin>
276+
<plugin>
277+
<groupId>org.apache.maven.plugins</groupId>
278+
<artifactId>maven-javadoc-plugin</artifactId>
279+
<version>2.9.1</version>
280+
<executions>
281+
<execution>
282+
<id>attach-javadocs</id>
283+
<goals>
284+
<goal>jar</goal>
285+
</goals>
286+
</execution>
287+
</executions>
288+
</plugin>
289+
<plugin>
290+
<groupId>org.apache.maven.plugins</groupId>
291+
<artifactId>maven-gpg-plugin</artifactId>
292+
<version>1.5</version>
293+
<executions>
294+
<execution>
295+
<id>sign-artifacts</id>
296+
<phase>verify</phase>
297+
<goals>
298+
<goal>sign</goal>
299+
</goals>
300+
</execution>
301+
</executions>
302+
</plugin>
303+
</plugins>
304+
</build>
305+
</profile>
306+
307+
<!-- Disable doclint in Java 8. See http://stackoverflow.com/questions/15886209/maven-is-not-working-in-java-8-when-javadoc-tags-are-incomplete.
308+
TODO(mberlin): Remove this once we fixed all lint errors. -->
309+
<profile>
310+
<id>disable-java8-doclint</id>
311+
<activation>
312+
<jdk>[1.8,)</jdk>
313+
</activation>
314+
<properties>
315+
<additionalparam>-Xdoclint:none</additionalparam>
316+
</properties>
317+
</profile>
318+
</profiles>
319+
238320
</project>

0 commit comments

Comments
 (0)