Skip to content

Commit

Permalink
infra(maven): release to sonatype
Browse files Browse the repository at this point in the history
  • Loading branch information
vaubenexapp committed Mar 24, 2020
1 parent 21a6b8d commit 4857903
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 41 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
language: java
notifications:
email: false

before_script:
- mvn clean package -DskipTests

script:
- mvn test
14 changes: 1 addition & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![Build Status](https://travis-ci.org/Nexapp/NexappCore.svg?branch=master)](https://travis-ci.org/Nexapp/NexappCore)
[![Maven Central](https://img.shields.io/maven-central/v/ca.nexapp/core)](https://search.maven.org/search?q=ca.nexapp)

# Nexapp Core
Several Java mini-modules for REST APIs.
Expand Down Expand Up @@ -132,19 +133,6 @@ ServiceLocator.reset(); // Clear all registrations
```

## How to use it
At the moment, this project is hosted on GitHub and not on Maven Central.

In your `pom.xml`, you must add the GitHub repository as follows:
```
<repositories>
<repository>
<id>nexapp-core-mvn-repo</id>
<url>https://raw.github.com/nexapp/nexappcore/mvn-repo/</url>
</repository>
</repositories>
```

Then, you simply add the dependency as follows:
```
<dependency>
<groupId>ca.nexapp</groupId>
Expand Down
114 changes: 86 additions & 28 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,34 @@
<packaging>jar</packaging>

<name>Nexapp Core</name>
<description>Several Java classes for REST APIs.</description>
<url>https://github.com/Nexapp/NexappCore</url>
<licenses>
<license>
<name>Apache License 2.0</name>
<url>https://github.com/Nexapp/NexappCore/blob/master/LICENSE</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>nexapp</id>
<organization>Nexapp</organization>
<organizationUrl>https://nexapp.ca</organizationUrl>
<roles>
<role>developer</role>
</roles>
</developer>
</developers>
<scm>
<url>
https://github.com/Nexapp/NexappCore.git
</url>
</scm>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<github.global.server>github</github.global.server>
</properties>

<build>
Expand All @@ -29,47 +52,82 @@
</plugin>

<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.1</version>
<configuration>
<altDeploymentRepository>internal.repo::default::file://${project.build.directory}/mvn-repo</altDeploymentRepository>
</configuration>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>com.github.github</groupId>
<artifactId>site-maven-plugin</artifactId>
<version>0.12</version>
<configuration>
<message>Maven artifacts for ${project.version}</message>
<noJekyll>true</noJekyll>
<outputDirectory>${project.build.directory}/mvn-repo</outputDirectory>
<branch>refs/heads/mvn-repo</branch>
<includes>
<include>**/*</include>
</includes>
<merge>true</merge>
<repositoryName>NexappCore</repositoryName>
<repositoryOwner>Nexapp</repositoryOwner>
</configuration>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<executions>
<!-- run site-maven-plugin's 'site' target as part of the build's normal 'deploy' phase -->
<execution>
<phase>prepare-package</phase>
<goals>
<goal>site</goal>
<goal>jar</goal>
</goals>
<phase>deploy</phase>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>

<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-release-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<useReleaseProfile>false</useReleaseProfile>
<releaseProfiles>release</releaseProfiles>
<goals>deploy</goals>
</configuration>
</plugin>
</plugins>
</build>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>internal.repo</id>
<name>Temporary Staging Repository</name>
<url>file://${project.build.directory}/mvn-repo</url>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

Expand Down Expand Up @@ -127,4 +185,4 @@
<version>1.11</version>
</dependency>
</dependencies>
</project>
</project>

0 comments on commit 4857903

Please sign in to comment.