Skip to content

Commit

Permalink
Merge pull request #26 from majusko/feature/maven-central-release
Browse files Browse the repository at this point in the history
Maven central support.
  • Loading branch information
majusko authored Sep 22, 2020
2 parents 150a9a4 + edc818f commit 5779f2f
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ build/

### VS Code ###
.vscode/

my-settings.xml
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ jdk:
dist: trusty
after_success:
- bash <(curl -s https://codecov.io/bash)
- "[[ $TRAVIS_BRANCH == \"master\" ]] && { mvn deploy --settings travis-settings.xml -DskipTests=true -B; };"
before_deploy:
- "mvn -DskipTests package"
- export FILE_TO_UPLOAD=$(ls target/grpc-jwt-spring-boot-starter-*.jar)
Expand Down
27 changes: 27 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Release process

### 1. On some machines you need to run this first

Because of: https://github.com/keybase/keybase-issues/issues/2798

```yaml
export GPG_TTY=$(tty)
```

### 2. Prepare your `my-settings.xml`

```xml
<servers>
<server>
<id>ossrh</id>
<username>${env.SONATYPE_USERNAME}</username>
<password>${env.SONATYPE_PASSWORD}</password>
</server>
</servers>
```

### 3. Execute release command

```yaml
mvn clean deploy -P release-sign-artifacts --settings my-settings.xml
```
61 changes: 59 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>io.github.majusko</groupId>
<artifactId>grpc-jwt-spring-boot-starter</artifactId>
<version>1.0.7-SNAPSHOT</version>
<version>1.0.7</version>
<name>grpc-jwt-spring-boot-starter</name>
<description>JWT Auth for your Grpc Spring Boot project</description>

Expand Down Expand Up @@ -101,6 +101,64 @@

</dependencies>

<profiles>
<profile>
<id>release-sign-artifacts</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.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>3.1.1</version>
<configuration>
<detectJavaApiLink>false</detectJavaApiLink>
</configuration>
<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>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>

<extensions>
Expand Down Expand Up @@ -142,7 +200,6 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.3.4.RELEASE</version>
<executions>
<!-- use original jar for install/deploy instead of executable spring boot jar -->
<execution>
Expand Down
12 changes: 12 additions & 0 deletions travis-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<server>
<!-- Maven Central Deployment -->
<id>ossrh</id>
<username>${env.SONATYPE_USERNAME}</username>
<password>${env.SONATYPE_PASSWORD}</password>
</server>
</servers>
</settings>

0 comments on commit 5779f2f

Please sign in to comment.