Skip to content

Commit bcfc214

Browse files
authored
♻️ migrate to maven central (#247)
1 parent 41b8d5c commit bcfc214

File tree

3 files changed

+20
-40
lines changed

3 files changed

+20
-40
lines changed

.github/workflows/_publish-code.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,15 @@ jobs:
1919
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
2020
gpg --list-secret-keys --keyid-format LONG
2121
22-
- name: Set up Maven Central Repository
22+
- name: Set up JDK
2323
uses: actions/setup-java@v4
2424
with:
2525
java-version: "8"
2626
distribution: "adopt"
27-
server-id: ossrh
28-
server-username: MAVEN_USERNAME
29-
server-password: MAVEN_PASSWORD
3027

3128
- id: publish-to-central
3229
name: Publish to Central Repository
33-
env:
34-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
35-
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
3630
run: |
37-
mvn \
38-
--no-transfer-progress \
39-
--batch-mode \
31+
mvn --update-snapshots \
4032
-Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} \
41-
clean deploy -P release
33+
clean deploy -P release verify

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,6 @@ hs_err_pid*
4646

4747
# Mindee Test files
4848
local_test/
49+
50+
# local config
51+
settings.xml

pom.xml

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,8 @@
3030
</developer>
3131
</developers>
3232

33-
<distributionManagement>
34-
<snapshotRepository>
35-
<id>ossrh</id>
36-
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
37-
</snapshotRepository>
38-
<repository>
39-
<id>ossrh</id>
40-
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
41-
</repository>
42-
</distributionManagement>
43-
4433
<build>
45-
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
34+
<pluginManagement>
4635
<plugins>
4736
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
4837
<plugin>
@@ -70,10 +59,6 @@
7059
<artifactId>maven-install-plugin</artifactId>
7160
<version>${org.apache.maven.install.version}</version>
7261
</plugin>
73-
<plugin>
74-
<artifactId>maven-deploy-plugin</artifactId>
75-
<version>${org.apache.maven.deploy.version}</version>
76-
</plugin>
7762
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
7863
<plugin>
7964
<artifactId>maven-site-plugin</artifactId>
@@ -136,17 +121,6 @@
136121
</execution>
137122
</executions>
138123
</plugin>
139-
<plugin>
140-
<groupId>org.sonatype.plugins</groupId>
141-
<artifactId>nexus-staging-maven-plugin</artifactId>
142-
<version>${org.sonatype.nexus.staging.maven.version}</version>
143-
<extensions>true</extensions>
144-
<configuration>
145-
<serverId>ossrh</serverId>
146-
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
147-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
148-
</configuration>
149-
</plugin>
150124
</plugins>
151125
</pluginManagement>
152126
<plugins>
@@ -158,6 +132,16 @@
158132
<target>8</target>
159133
</configuration>
160134
</plugin>
135+
<plugin>
136+
<groupId>org.sonatype.central</groupId>
137+
<artifactId>central-publishing-maven-plugin</artifactId>
138+
<version>0.7.0</version>
139+
<extensions>true</extensions>
140+
<configuration>
141+
<publishingServerId>central</publishingServerId>
142+
<autoPublish>false</autoPublish>
143+
</configuration>
144+
</plugin>
161145
</plugins>
162146
</build>
163147

@@ -219,6 +203,9 @@
219203
<goals>
220204
<goal>sign</goal>
221205
</goals>
206+
<configuration>
207+
<keyname>opensource@mindee.co</keyname>
208+
</configuration>
222209
</execution>
223210
</executions>
224211
</plugin>
@@ -405,7 +392,6 @@
405392
<org.apache.httpcomponents.httpmime.version>4.5.14</org.apache.httpcomponents.httpmime.version>
406393
<org.apache.maven.clean.version>3.1.0</org.apache.maven.clean.version>
407394
<org.apache.maven.compiler.version>3.12.1</org.apache.maven.compiler.version>
408-
<org.apache.maven.deploy.version>3.1.1</org.apache.maven.deploy.version>
409395
<org.apache.maven.failsafe.version>3.3.0</org.apache.maven.failsafe.version>
410396
<org.apache.maven.gpg.version>1.5</org.apache.maven.gpg.version>
411397
<org.apache.maven.install.version>2.5.2</org.apache.maven.install.version>
@@ -426,7 +412,6 @@
426412
<org.projectlombok.lombok-mapstruct-binding.version>0.2.0</org.projectlombok.lombok-mapstruct-binding.version>
427413
<org.projectlombok.version>1.18.32</org.projectlombok.version>
428414
<org.slf4j.version>2.0.17</org.slf4j.version>
429-
<org.sonatype.nexus.staging.maven.version>1.6.12</org.sonatype.nexus.staging.maven.version>
430415
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
431416
<wiremock.version>2.27.2</wiremock.version>
432417
</properties>

0 commit comments

Comments
 (0)