Skip to content

Commit 5779f2f

Browse files
authored
Merge pull request #26 from majusko/feature/maven-central-release
Maven central support.
2 parents 150a9a4 + edc818f commit 5779f2f

File tree

5 files changed

+101
-2
lines changed

5 files changed

+101
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ build/
2929

3030
### VS Code ###
3131
.vscode/
32+
33+
my-settings.xml

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ jdk:
44
dist: trusty
55
after_success:
66
- bash <(curl -s https://codecov.io/bash)
7+
- "[[ $TRAVIS_BRANCH == \"master\" ]] && { mvn deploy --settings travis-settings.xml -DskipTests=true -B; };"
78
before_deploy:
89
- "mvn -DskipTests package"
910
- export FILE_TO_UPLOAD=$(ls target/grpc-jwt-spring-boot-starter-*.jar)

RELEASE.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Release process
2+
3+
### 1. On some machines you need to run this first
4+
5+
Because of: https://github.com/keybase/keybase-issues/issues/2798
6+
7+
```yaml
8+
export GPG_TTY=$(tty)
9+
```
10+
11+
### 2. Prepare your `my-settings.xml`
12+
13+
```xml
14+
<servers>
15+
<server>
16+
<id>ossrh</id>
17+
<username>${env.SONATYPE_USERNAME}</username>
18+
<password>${env.SONATYPE_PASSWORD}</password>
19+
</server>
20+
</servers>
21+
```
22+
23+
### 3. Execute release command
24+
25+
```yaml
26+
mvn clean deploy -P release-sign-artifacts --settings my-settings.xml
27+
```

pom.xml

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

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

@@ -101,6 +101,64 @@
101101

102102
</dependencies>
103103

104+
<profiles>
105+
<profile>
106+
<id>release-sign-artifacts</id>
107+
<activation>
108+
<property>
109+
<name>performRelease</name>
110+
<value>true</value>
111+
</property>
112+
</activation>
113+
<build>
114+
<plugins>
115+
<plugin>
116+
<groupId>org.apache.maven.plugins</groupId>
117+
<artifactId>maven-source-plugin</artifactId>
118+
<version>3.0.1</version>
119+
<executions>
120+
<execution>
121+
<id>attach-sources</id>
122+
<goals>
123+
<goal>jar-no-fork</goal>
124+
</goals>
125+
</execution>
126+
</executions>
127+
</plugin>
128+
<plugin>
129+
<groupId>org.apache.maven.plugins</groupId>
130+
<artifactId>maven-javadoc-plugin</artifactId>
131+
<version>3.1.1</version>
132+
<configuration>
133+
<detectJavaApiLink>false</detectJavaApiLink>
134+
</configuration>
135+
<executions>
136+
<execution>
137+
<id>attach-javadocs</id>
138+
<goals>
139+
<goal>jar</goal>
140+
</goals>
141+
</execution>
142+
</executions>
143+
</plugin>
144+
<plugin>
145+
<groupId>org.apache.maven.plugins</groupId>
146+
<artifactId>maven-gpg-plugin</artifactId>
147+
<executions>
148+
<execution>
149+
<id>sign-artifacts</id>
150+
<phase>verify</phase>
151+
<goals>
152+
<goal>sign</goal>
153+
</goals>
154+
</execution>
155+
</executions>
156+
</plugin>
157+
</plugins>
158+
</build>
159+
</profile>
160+
</profiles>
161+
104162
<build>
105163

106164
<extensions>
@@ -142,7 +200,6 @@
142200
<plugin>
143201
<groupId>org.springframework.boot</groupId>
144202
<artifactId>spring-boot-maven-plugin</artifactId>
145-
<version>2.3.4.RELEASE</version>
146203
<executions>
147204
<!-- use original jar for install/deploy instead of executable spring boot jar -->
148205
<execution>

travis-settings.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4+
<servers>
5+
<server>
6+
<!-- Maven Central Deployment -->
7+
<id>ossrh</id>
8+
<username>${env.SONATYPE_USERNAME}</username>
9+
<password>${env.SONATYPE_PASSWORD}</password>
10+
</server>
11+
</servers>
12+
</settings>

0 commit comments

Comments
 (0)