Skip to content

Commit 55200be

Browse files
authored
Merge pull request #485 from maxmind/greg/eng-1937
Release to Central Portal
2 parents 708e288 + c13b8db commit 55200be

6 files changed

Lines changed: 75 additions & 119 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
.settings
1414
doc
1515
hs_err*.log
16+
pom.xml.versionsBackup
1617
target
1718
reports
1819
Main.java

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
CHANGELOG
22
=========
33

4+
3.7.2 (2025-05-28)
5+
------------------
6+
7+
* First release using Central Portal instead of Legacy OSSRH.
8+
* Update `geoip2` dependency.
9+
410
3.7.1 (2025-05-23)
511
------------------
612

README.dev.md

Lines changed: 26 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,38 @@
11
# Preparing your environment for a release
22

33
- Ensure you have access to publish to the repository on
4-
[Sonatype](https://oss.sonatype.org).
5-
- See the section about Sonatype access.
4+
[Central Portal](https://central.sonatype.org/).
5+
- See the section about Central Portal access.
66
- You need a GPG secret key. You need to publish it as well.
77
- See the section about setting up GPG.
88
- Ensure the SSH key you use on GitHub.com is available.
99
- e.g., `~/.ssh/id_rsa`.
1010
- Ensure an appropriate `~/.gitconfig` is set up.
1111
- The release process generates commits.
1212
- Ensure you have the necessary dependencies available:
13-
- e.g., `apt-get install maven openjdk-8-jdk git-core gpg`
13+
- e.g., `apt-get install maven default-jdk git-core`
1414
- Ensure [gh](https://github.com/cli/cli) is set up and in your
1515
`PATH`.
1616
- An easy way to do this is get a release tarball and run `./install`.
1717

18-
## Setting up Sonatype access
18+
## Setting up Central Portal access
1919

20-
To get this access, make an account on the [Sonatype JIRA issue
21-
tracker](https://issues.sonatype.org/) and make an issue asking for access
22-
[like so](https://issues.sonatype.org/browse/OSSRH-34414).
20+
To get this access, first create a Central Portal account. You will then need
21+
access to our namespace, but we have not added anyone since switching to
22+
Central Portal. Previously you would need to make an account on the [Sonatype
23+
JIRA issue tracker](https://issues.sonatype.org/) and make an issue asking for
24+
access [like so](https://issues.sonatype.org/browse/OSSRH-34414).
2325

2426
Ensure you inform MaxMind operations about your new access.
2527

26-
Put this information into `~/.m2/settings.xml` (Maven settings). Your
27-
`settings.xml` should look something like (replace USERNAME and SECRET):
28-
29-
<settings>
30-
<servers>
31-
<server>
32-
<id>ossrh</id>
33-
<username>USERNAME</username>
34-
<password>SECRET</password>
35-
</server>
36-
<server>
37-
<id>sonatype-nexus-snapshots</id>
38-
<username>USERNAME</username>
39-
<password>SECRET</password>
40-
</server>
41-
<server>
42-
<id>sonatype-nexus-staging</id>
43-
<username>USERNAME</username>
44-
<password>SECRET</password>
45-
</server>
46-
<server>
47-
<id>github-project-site</id>
48-
<username>git</username>
49-
</server>
50-
</servers>
51-
<profiles>
52-
<profile>
53-
<id>my_profile_id</id>
54-
<activation>
55-
<activeByDefault>true</activeByDefault>
56-
</activation>
57-
<properties>
58-
<gpg.keyname><!-- The GPG ID of your publishing key --></gpg.keyname>
59-
</properties>
60-
</profile>
61-
</profiles>
62-
</settings>
63-
64-
Some links about Sonatype:
65-
66-
* http://central.sonatype.org/pages/ossrh-guide.html
67-
* http://central.sonatype.org/pages/releasing-the-deployment.html
68-
* http://central.sonatype.org/pages/apache-maven.html
69-
70-
See the following documentation for details on specifying which gpg to use for
71-
publishing in your local settings.xml:
72-
73-
* https://central.sonatype.org/publish/requirements/gpg/
74-
* https://maven.apache.org/plugins/maven-gpg-plugin/usage.html
28+
Configure your `~/.m2/settings.xml` file for releasing to Central Portal. See
29+
[these instructions](https://central.sonatype.org/publish/publish-portal-maven/#credentials).
30+
31+
Some links about Central Portal:
32+
33+
* [Maven Central Repository homepage](https://central.sonatype.com/). You can
34+
sign-in from here.
35+
* [Publishing guide](https://central.sonatype.org/publish/publish-portal-maven/)
7536

7637
## Setting up GPG
7738

@@ -130,29 +91,20 @@ Add this to ~/.gnupg/gpg-agent.conf:
13091
version to the next development release, upload the release to GitHub
13192
and tag it, and upload to Sonatype.
13293
- This will prompt you several times. Generally you need to say `y` or `n`.
133-
- You'll be prompted for your ssh key password, GPG key password, and
134-
GitHub.com username and password several times depending on your
135-
workspace.
136-
- You may be prompted about "what is the next development version?". Hit
137-
enter to use the default which should be fine.
94+
- You may be prompted for your GitHub.com username and password several
95+
times depending on your workspace.
13896
- You may be prompted about "The following dependencies in Dependencies
13997
have newer versions". See the section about updating dependencies if so.
140-
- If you get HTTP 401 errors from Sonatype, you probably don't have a
141-
correct `settings.xml`. Refer to the Sonatype section.
142-
- If this happened, there are most likely pushed commits on GitHub.com.
143-
You can potentially rebase and drop the commits and force push and
144-
start over (you might want to talk about this before doing it). Note
145-
you'll need to delete the release tag too:
146-
`git push origin :refs/tags/vx.y.z && git tag -d vx.y.z`.
147-
- If you get to this point, then a release is on GitHub.com and in the
148-
staging repository on [Sonatype](https://oss.sonatype.org). The
149-
nexus-staging-maven-plugin plugin should automatically close the staging
150-
release as well as actually release it after.
98+
- If you get HTTP 401 errors from Central Portal, you probably don't have a
99+
correct `settings.xml`. Refer to the Central Portal section.
100+
- If you get to this point, then a release is on GitHub.com and Maven
101+
Central.
151102
- You're done!
152103
- If you want to check things over, look at the commits on GitHub.com,
153104
including to the `gh-pages` branch and release tags, and do an artifact
154-
search on [Sonatype](https://oss.sonatype.org) to see the version is as
155-
you expect.
105+
search on [Maven Central](https://central.sonatype.com/) to see the version
106+
is as you expect. It may take a few minutes for new releases to show up
107+
on Maven Central.
156108

157109
## Updating dependencies
158110

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ To do this, add the dependency to your pom.xml:
1616
<dependency>
1717
<groupId>com.maxmind.minfraud</groupId>
1818
<artifactId>minfraud</artifactId>
19-
<version>3.7.1</version>
19+
<version>3.7.2</version>
2020
</dependency>
2121
```
2222

@@ -29,7 +29,7 @@ repositories {
2929
mavenCentral()
3030
}
3131
dependencies {
32-
compile 'com.maxmind.minfraud:minfraud:3.7.1'
32+
compile 'com.maxmind.minfraud:minfraud:3.7.2'
3333
}
3434
```
3535

dev-bin/release.sh

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -eu -o pipefail
55
changelog=$(cat CHANGELOG.md)
66

77
regex='
8-
([0-9]+\.[0-9]+\.[0-9]+(-[^ ]+)?) \(([0-9]{4}-[0-9]{2}-[0-9]{2})\)
8+
([0-9]+\.[0-9]+\.[0-9]+[a-zA-Z0-9\-]*) \(([0-9]{4}-[0-9]{2}-[0-9]{2})\)
99
-*
1010
1111
((.|
@@ -18,8 +18,8 @@ if [[ ! $changelog =~ $regex ]]; then
1818
fi
1919

2020
version="${BASH_REMATCH[1]}"
21-
date="${BASH_REMATCH[3]}"
22-
notes="$(echo "${BASH_REMATCH[4]}" | sed -n -E '/^[0-9]+\.[0-9]+\.[0-9]+/,$!p')"
21+
date="${BASH_REMATCH[2]}"
22+
notes="$(echo "${BASH_REMATCH[3]}" | sed -n -e '/^[0-9]\+\.[0-9]\+\.[0-9]\+/,$!p')"
2323

2424
if [[ "$date" != $(date +"%Y-%m-%d") ]]; then
2525
echo "$date is not today!"
@@ -53,7 +53,16 @@ popd
5353
mvn versions:display-plugin-updates
5454
mvn versions:display-dependency-updates
5555

56-
read -e -p "Continue given above dependencies? (y/n) " should_continue
56+
read -r -n 1 -p "Continue given above dependencies? (y/n) " should_continue
57+
58+
if [ "$should_continue" != "y" ]; then
59+
echo "Aborting"
60+
exit 1
61+
fi
62+
63+
mvn test
64+
65+
read -r -n 1 -p "Continue given above tests? (y/n) " should_continue
5766

5867
if [ "$should_continue" != "y" ]; then
5968
echo "Aborting"
@@ -64,36 +73,36 @@ page=.gh-pages/index.md
6473
cat <<EOF > $page
6574
---
6675
layout: default
67-
title: MaxMind minFraud Score and Insights Java API
76+
title: MaxMind minFraud Java API
6877
language: java
6978
version: $tag
7079
---
7180
7281
EOF
7382

83+
mvn versions:set -DnewVersion="$version"
84+
7485
perl -pi -e "s/(?<=<version>)[^<]*/$version/" README.md
75-
perl -pi -e "s/(?<=com\.maxmind\.minfraud\:minfraud\:)\d+\.\d+\.\d+[^']*/$version/" README.md
86+
perl -pi -e "s/(?<=com\.maxmind\.minfraud\:minfraud\:)\d+\.\d+\.\d+([\w\-]+)?/$version/" README.md
7687

7788
cat README.md >> $page
7889

79-
if [ -n "$(git status --porcelain)" ]; then
80-
git diff
81-
82-
read -e -p "Commit README.md changes? " should_commit
83-
if [ "$should_commit" != "y" ]; then
84-
echo "Aborting"
85-
exit 1
86-
fi
87-
git add README.md
88-
git commit -m 'update version number in README.md'
90+
git diff
91+
92+
read -r -n 1 -p "Commit changes? " should_commit
93+
if [ "$should_commit" != "y" ]; then
94+
echo "Aborting"
95+
exit 1
8996
fi
97+
git add README.md pom.xml
98+
git commit -m "Preparing for $version"
99+
100+
mvn clean deploy
90101

91-
# could be combined with the primary build
92-
mvn release:clean
93-
mvn release:prepare -DreleaseVersion="$version" -Dtag="$tag"
94-
mvn release:perform
95102
rm -fr ".gh-pages/doc/$tag"
96-
cp -r target/checkout/target/reports/apidocs ".gh-pages/doc/$tag"
103+
cp -r target/reports/apidocs ".gh-pages/doc/$tag"
104+
rm -f .gh-pages/doc/latest
105+
ln -fs "$tag" .gh-pages/doc/latest
97106

98107
pushd .gh-pages
99108

@@ -105,8 +114,7 @@ echo "Release notes for $version:
105114
$notes
106115
107116
"
108-
109-
read -e -p "Push to origin? " should_push
117+
read -r -n 1 -p "Push to origin? " should_push
110118

111119
if [ "$should_push" != "y" ]; then
112120
echo "Aborting"
@@ -118,8 +126,7 @@ git push
118126
popd
119127

120128
git push
121-
git push --tags
122129

123130
gh release create --target "$(git branch --show-current)" -t "$version" -n "$notes" "$tag" \
124-
"target/checkout/target/minfraud-$version-with-dependencies.zip" \
125-
"target/checkout/target/minfraud-$version-with-dependencies.zip.asc"
131+
"target/minfraud-$version-with-dependencies.zip" \
132+
"target/minfraud-$version-with-dependencies.zip.asc"

pom.xml

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>com.maxmind.minfraud</groupId>
66
<artifactId>minfraud</artifactId>
7-
<version>3.7.2-SNAPSHOT</version>
7+
<version>3.7.2</version>
88
<name>MaxMind minFraud API</name>
99
<description>MaxMind minFraud Score, Insights, Factors and Report Transaction API</description>
1010
<url>http://dev.maxmind.com/minfraud</url>
@@ -60,7 +60,7 @@
6060
<dependency>
6161
<groupId>com.maxmind.geoip2</groupId>
6262
<artifactId>geoip2</artifactId>
63-
<version>4.3.0</version>
63+
<version>4.3.1</version>
6464
</dependency>
6565
<dependency>
6666
<groupId>commons-validator</groupId>
@@ -255,24 +255,14 @@
255255
<version>2.18.0</version>
256256
</plugin>
257257
<plugin>
258-
<groupId>org.sonatype.plugins</groupId>
259-
<artifactId>nexus-staging-maven-plugin</artifactId>
260-
<version>1.7.0</version>
258+
<groupId>org.sonatype.central</groupId>
259+
<artifactId>central-publishing-maven-plugin</artifactId>
260+
<version>0.7.0</version>
261261
<extensions>true</extensions>
262262
<configuration>
263-
<serverId>sonatype-nexus-staging</serverId>
264-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
265-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
263+
<publishingServerId>central</publishingServerId>
264+
<autoPublish>true</autoPublish>
266265
</configuration>
267-
<executions>
268-
<execution>
269-
<id>default-deploy</id>
270-
<phase>deploy</phase>
271-
<goals>
272-
<goal>deploy</goal>
273-
</goals>
274-
</execution>
275-
</executions>
276266
</plugin>
277267
</plugins>
278268
</build>

0 commit comments

Comments
 (0)