Skip to content

Commit 29df3e4

Browse files
authored
Migrating to Sonatype OSSRH from JCenter (#968)
Fixes #697 This change replaces JCenter with Sonatype OSSRH for snapshot and release management. To complete this change, we will need to add additional information to Travis, specifically the GPG information to sign the artifacts during a release. It's my opinion that those values should be in Travis directly and not here in this repository. I'm open to other suggestions and feedback on this approach. Additional changes include: * Updating BOM template to include SCM per OSSRH rules. * Removed Bintray and GitHub credentials, they are no longer needed. * Adding GPG Signing Values * Code Signing Paths
1 parent 5bc04de commit 29df3e4

File tree

7 files changed

+77
-63
lines changed

7 files changed

+77
-63
lines changed

.travis.yml

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -10,54 +10,21 @@ jdk:
1010
- openjdk8
1111
- openjdk11
1212

13-
before_install:
14-
# Parameters used during release
15-
- git config user.name "$GH_USER"
16-
- git config user.email "$GH_USER_EMAIL"
17-
# setup https authentication credentials, used by ./mvnw release:prepare
18-
- git config credential.helper "store --file=.git/credentials"
19-
- echo "https://$GH_TOKEN:@github.com" > .git/credentials
13+
before_install: ./travis/sign.sh
2014

2115
jobs:
2216
include:
2317
- stage: snapshot
24-
name: "Deploy Snapshot to JCenter"
18+
name: "Deploy Snapshot to OSSRH"
2519
if: branch = master AND type != pull_request AND commit_message !~ /^(prepare release ([0-9\.]+))$/
2620
jdk: openjdk8
2721
install: true
2822
script:
2923
- ./mvnw -B -nsu -s ./travis/settings.xml -P release -pl -:feign-benchmark -DskipTests=true deploy
3024
- stage: release
31-
name: "Release to JCenter"
25+
name: "Release to OSSRH and Central"
3226
if: tag =~ /^[0-9\.]+$/
3327
jdk: openjdk8
3428
install: true
3529
script:
36-
- ./mvnw -B -nsu -s ./travis/settings.xml -P release -pl -:feign-benchmark -DskipTests=true deploy
37-
- stage: sync
38-
name: "Sync with Maven Central"
39-
if: tag =~ /^[0-9\.]+$/
40-
jdk: openjdk8
41-
install: true
42-
script:
43-
# this step can take an inordinate amount of time, so the wait should push it to 30 minutes
44-
- travis_wait 30 ./mvnw -B -nsu -s ./travis/settings.xml -N io.zipkin.centralsync-maven-plugin:centralsync-maven-plugin:sync
45-
46-
env:
47-
global:
48-
# Ex. travis encrypt BINTRAY_USER=your_github_account
49-
- secure: "VeTOgXwhZLf8uwlnYpB9tuY+NV6kiooRN0FMDoWCXuPPSz/tX2mqmshBXDYsJu0EcRtZb21MkbQwbdJ8Th9K/bvj4sGNK1PrBm9Hmz6e2AvAcxn3ROv86GMTkd7O25OsipTT+/qWrbR3s3lHQxYo5WMsrlEmJ/EF5y5Go5wx90c="
50-
# Ex. travis encrypt BINTRAY_KEY=xxx-https://bintray.com/profile/edit-xxx --add
51-
- secure: "WND+fjAqpdHArSbXAK7l0dpQLrX0hL/XymV02rhe0pVT1g0J1V32ncqDCVnn/73wTiECTen6y3o1vq3ByIdT9tUErt3o8oEROQsI/cVX9IhvJ/DtcW1lqafXKmQZwDQsifVxhKroW1VuZQbGrKnqVUzfqx5OzxgoNVWpkkxhf50="
52-
# Ex. travis encrypt [email protected] --add
53-
- secure: "dG1Qt8bqe3TsmLOmYpWYsI55N0zLWCsupdpS7zMOedpM2q0laac56uc2gGV6qQIPdJQdCWzr9CE/h1nG4lJdJfreC13reQ3PDF79Yh8tMvdO1iwrSeIQ7eeRY6hs72GUtdIhfwetUgwCgIJpmBHS7O3yJhxQAOmu5twAuABiuSE="
54-
# Ex. travis encrypt GH_USER=your_github_account --add
55-
- secure: "DY28uU8wadasLCWSpl6KJyilGAAjSKzr3VPQ8by02eLDaAgCVq5KeYM0tjM804Rzhq3bjcXofaldj9QpWNTYC5SL6IIN5I5W+dWIZ8JzZ/rjOZgtJMMr4zcjOc5set9MsTUirB694m3c8bzhQZkah9YwUa/OuX1D8Ym/806igsE="
56-
# Ex. travis encrypt GH_TOKEN=XXX-https://github.com/settings/tokens-XXX --add
57-
- secure: "NmydUhuJLZ/Eg0cpCz6eZiYvsLHtSYrLIAOT2VHfUdzl/Q3PGXoodTpTqRkW7Uuj5lSYYw6cQnhiTly2dvomQYj+es5hSfIzFLvlF0x7L+aFX2IySJhn2Cg8tp5H0hn2UL8t6jDfmdJrLwGKT6EsiXYIgt4dPWJ7ZZ1SRDFp2Cg="
58-
# Ex. travis encrypt SONATYPE_USER=your_sonatype_account
59-
- secure: "ONAU76S0WBGcQGf0mr7KxKQjFvhhu73GNuQG8j47pxhJojNlNpWBbu+EGkgaInWKMtO89iBtpicVlXZc06HtbSqv7L93gbMo+xgp5daLlQg4gocDixjB1I2oPPITFFoztu76nOA1IBWRLTKu+w+Y2tKOmzWm+5v2UKD6fz7SYoo="
60-
# Ex. travis encrypt SONATYPE_PASSWORD=your_sonatype_password
61-
- secure: "UaVTxnw8klS36WLAdcmubqrHIgS4o5NcIqQMPIihk0tv3VEvCJSGvc2b7EPyQZMvm5TR3mXq5IJUAHp8j3seAHfYWmLIZWzvn7Y5mLRw8Kh9up7GzXl8Idui0AEHAAL2mfvE9smlOKPS5D13LKc6tOGFER66itHW3Jg1QoijDmQ="
62-
# Ex. travis encrypt GITHUB_TOKEN=token_for_tests
63-
- secure: "H4PuppuPE3lkvVQ1osulhgWeZmpIkDKj/z74lx4MUeDPNtcuqpwmTVWtL5Zyjf8CxlALX2djx4RIBshaQAu4GtKarPLONinNLZ/TCtoK8dF08/ESxLEiLQzwGkS+geWoEFiZncB5Px2T7ZbUfVFO3crVY9CLn35znR8k1uidocL0JlyVPGwCwuBxFmDhs3BZh3JvbwSikAVRvlCRU6BbREFQbSK1EamuUju/rlo+dx7W5tiiuEJJ50c8vpgatTFyy821YP82fMRrhuBDpS4/rsL9DmLhQTEbCjZW+22DhEFPRlo0XIfidC7APybXnu3oO+jFuGaFKiQdy7sjB03g/Bz5H7jAIAkbl8UpbjN+IoeUU/OgMuBYf5wJjPDYUEdI3CXqywPn0xYZwVsOcSg+UkQGYdW9ux/U+nKsYLXLWWhst2QMFzbmO94KCrpgCW4mshr/5WP4XU6cEJwDsKMAUPWuOk0KMMjIufSgvPvteWZwT9akZwzEMuGaUQ5kLr1X6xTPv1cKXTreitaoOLQs28kmPVfTwVEdareaSVXcRqeflJJBSXkAgBqGhV5CAEUaUgt9/QD0Jj5RGyRPllFcydXVLTPeg62X/L5COswlvJhPkvfNnkbMpDQZYojKKPmAf+UqZJmVYPpOoNEXygldueKeunWkna/wYkMj0YnOkM8="
30+
- ./mvnw -B -nsu -s ./travis/settings.xml -P release -pl -:feign-benchmark -DskipTests=true deploy

mvnw.cmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do s
117117
:endReadAdditionalConfig
118118

119119
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
120-
121-
set WRAPPER_JAR=""%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar""
120+
121+
set WRAPPER_JAR=""%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar""
122122
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
123123

124-
# avoid using MAVEN_CMD_LINE_ARGS below since that would loose parameter escaping in %*
124+
@rem avoid using MAVEN_CMD_LINE_ARGS below since that would loose parameter escaping in %*
125125
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
126126
if ERRORLEVEL 1 goto error
127127
goto end

pom.xml

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
<bom.template.file.path>file://${project.basedir}/src/config/bom.xml</bom.template.file.path>
9191
<maven-scm-plugin.version>1.11.2</maven-scm-plugin.version>
9292
<maven-versions-plugin.version>2.7</maven-versions-plugin.version>
93+
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
9394
</properties>
9495
<url>https://github.com/openfeign/feign</url>
9596
<inceptionYear>2012</inceptionYear>
@@ -140,12 +141,12 @@
140141

141142
<distributionManagement>
142143
<repository>
143-
<id>bintray</id>
144-
<url>https://api.bintray.com/maven/openfeign/maven/feign/;publish=1</url>
144+
<id>ossrh</id>
145+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
145146
</repository>
146147
<snapshotRepository>
147-
<id>jfrog-snapshots</id>
148-
<url>http://oss.jfrog.org/artifactory/oss-snapshot-local</url>
148+
<id>ossrh</id>
149+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
149150
</snapshotRepository>
150151
</distributionManagement>
151152

@@ -320,7 +321,6 @@
320321
<version>${slf4j.version}</version>
321322
</dependency>
322323

323-
324324
</dependencies>
325325
</dependencyManagement>
326326

@@ -617,6 +617,17 @@
617617
<tag>${project.version}</tag>
618618
</configuration>
619619
</plugin>
620+
<plugin>
621+
<groupId>org.sonatype.plugins</groupId>
622+
<artifactId>nexus-staging-maven-plugin</artifactId>
623+
<version>1.6.8</version>
624+
<extensions>true</extensions>
625+
<configuration>
626+
<serverId>ossrh</serverId>
627+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
628+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
629+
</configuration>
630+
</plugin>
620631
</plugins>
621632
</build>
622633

@@ -719,6 +730,20 @@
719730
</execution>
720731
</executions>
721732
</plugin>
733+
<plugin>
734+
<groupId>org.apache.maven.plugins</groupId>
735+
<artifactId>maven-gpg-plugin</artifactId>
736+
<version>${maven-gpg-plugin.version}</version>
737+
<executions>
738+
<execution>
739+
<id>sign-artifacts</id>
740+
<goals>
741+
<goal>sign</goal>
742+
</goals>
743+
<phase>verify</phase>
744+
</execution>
745+
</executions>
746+
</plugin>
722747
</plugins>
723748
</build>
724749
</profile>

src/config/bom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@
3939
</licenses>
4040
#end
4141

42+
<scm>
43+
<url>https://github.com/openfeign/feign</url>
44+
<connection>scm:git:https://github.com/openfeign/feign.git</connection>
45+
<developerConnection>scm:git:https://github.com/openfeign/feign.git</developerConnection>
46+
<tag>HEAD</tag>
47+
</scm>
48+
4249
#if ($model.developers && !$model.developers.isEmpty())
4350
<developers>#foreach($d in $model.developers)
4451

travis/codesigning.asc.enc

9.14 KB
Binary file not shown.

travis/settings.xml

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,28 @@
1414
1515
-->
1616
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
17-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18-
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
17+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
1919
http://maven.apache.org/xsd/settings-1.0.0.xsd">
2020
<servers>
2121
<server>
22-
<id>sonatype</id>
22+
<id>ossrh</id>
2323
<username>${env.SONATYPE_USER}</username>
2424
<password>${env.SONATYPE_PASSWORD}</password>
2525
</server>
26-
<server>
27-
<id>bintray</id>
28-
<username>${env.BINTRAY_USER}</username>
29-
<password>${env.BINTRAY_KEY}</password>
30-
</server>
31-
<server>
32-
<id>jfrog-snapshots</id>
33-
<username>${env.BINTRAY_USER}</username>
34-
<password>${env.BINTRAY_KEY}</password>
35-
</server>
36-
<server>
37-
<id>github.com</id>
38-
<username>${env.GH_USER}</username>
39-
<password>${env.GH_TOKEN}</password>
40-
</server>
4126
</servers>
27+
<profiles>
28+
<profile>
29+
<id>ossrh</id>
30+
<activation>
31+
<activeByDefault>true</activeByDefault>
32+
</activation>
33+
<properties>
34+
<gpg.executable>gpg</gpg.executable>
35+
<gpg.keyname>${env.GPG_KEYNAME}</gpg.keyname>
36+
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
37+
</properties>
38+
</profile>
39+
</profiles>
4240
</settings>
4341

travis/sign.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright 2012-2019 The Feign Authors
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
6+
# in compliance with the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software distributed under the License
11+
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12+
# or implied. See the License for the specific language governing permissions and limitations under
13+
# the License.
14+
#
15+
16+
openssl aes-256-cbc -K $encrypted_8beb152aadd6_key -iv $encrypted_8beb152aadd6_iv -in travis/codesigning.asc.enc -out travis/codesigning.asc -d
17+
gpg --fast-import travis/codesigning.asc

0 commit comments

Comments
 (0)