Skip to content

Commit 8207011

Browse files
committed
adds config for publishing to maven central
1 parent 7d48388 commit 8207011

2 files changed

Lines changed: 78 additions & 53 deletions

File tree

.github/workflows/ci.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ jobs:
125125
name: bloscjni-${{ matrix.os }}
126126
path: src/main/resources
127127

128-
build_jar:
128+
build_publish_jar:
129129
needs: [ build_bloscjni ]
130130
runs-on: ubuntu-latest
131131
steps:
@@ -155,3 +155,15 @@ jobs:
155155
with:
156156
name: blosc-jar
157157
path: target/*.jar
158+
159+
- name: Publish to Maven Central
160+
env:
161+
JRELEASER_NEXUS2_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }}
162+
JRELEASER_NEXUS2_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_PASSWORD }}
163+
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
164+
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
165+
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
166+
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
167+
run: |
168+
mvn jreleaser:deploy
169+

pom.xml

Lines changed: 65 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<groupId>com.scalableminds</groupId>
88
<artifactId>blosc-java</artifactId>
99
<version>0.1-1.21.4-SNAPSHOT</version>
10+
<inceptionYear>2023</inceptionYear>
1011

1112
<name>blosc-java</name>
1213
<description>A Java library for the Blosc codec that wraps around the c-blosc library with JNI.
@@ -42,60 +43,72 @@
4243
<artifactId>pomchecker-maven-plugin</artifactId>
4344
<version>1.9.0</version>
4445
</plugin>
45-
<plugin>
46-
<groupId>org.apache.maven.plugins</groupId>
47-
<artifactId>maven-javadoc-plugin</artifactId>
48-
<version>3.5.0</version>
49-
<executions>
50-
<execution>
51-
<id>attach-javadoc</id>
52-
<goals>
53-
<goal>jar</goal>
54-
</goals>
55-
</execution>
56-
</executions>
57-
</plugin>
58-
<plugin>
59-
<groupId>org.apache.maven.plugins</groupId>
60-
<artifactId>maven-source-plugin</artifactId>
61-
<version>3.3.0</version>
62-
<executions>
63-
<execution>
64-
<id>attach-source</id>
65-
<goals>
66-
<goal>jar</goal>
67-
</goals>
68-
</execution>
69-
</executions>
70-
</plugin>
71-
<plugin>
72-
<groupId>org.jreleaser</groupId>
73-
<artifactId>jreleaser-maven-plugin</artifactId>
74-
<version>1.7.0</version>
75-
<configuration>
76-
<jreleaser>
77-
<signing>
78-
<active>ALWAYS</active>
79-
<armored>true</armored>
80-
</signing>
81-
<deploy>
82-
<maven>
83-
<nexus2>
84-
<maven-central>
85-
<active>ALWAYS</active>
86-
<url>https://s01.oss.sonatype.org/service/local</url>;
87-
<closeRepository>false</closeRepository>
88-
<releaseRepository>false</releaseRepository>
89-
<stagingRepositories>target/staging-deploy</stagingRepositories>
90-
</maven-central>
91-
</nexus2>
92-
</maven>
93-
</deploy>
94-
</jreleaser>
95-
</configuration>
96-
</plugin>
9746
</plugins>
9847
</build>
48+
49+
<profiles>
50+
<profile>
51+
<id>release</id>
52+
<build>
53+
<plugins>
54+
<plugin>
55+
<groupId>org.apache.maven.plugins</groupId>
56+
<artifactId>maven-javadoc-plugin</artifactId>
57+
<version>3.5.0</version>
58+
<executions>
59+
<execution>
60+
<id>attach-javadoc</id>
61+
<goals>
62+
<goal>jar</goal>
63+
</goals>
64+
</execution>
65+
</executions>
66+
</plugin>
67+
<plugin>
68+
<groupId>org.apache.maven.plugins</groupId>
69+
<artifactId>maven-source-plugin</artifactId>
70+
<version>3.3.0</version>
71+
<executions>
72+
<execution>
73+
<id>attach-source</id>
74+
<goals>
75+
<goal>jar</goal>
76+
</goals>
77+
</execution>
78+
</executions>
79+
</plugin>
80+
<plugin>
81+
<groupId>org.jreleaser</groupId>
82+
<artifactId>jreleaser-maven-plugin</artifactId>
83+
<version>1.7.0</version>
84+
<configuration>
85+
<jreleaser>
86+
<signing>
87+
<active>ALWAYS</active>
88+
<armored>true</armored>
89+
</signing>
90+
<deploy>
91+
<maven>
92+
<nexus2>
93+
<maven-central>
94+
<active>ALWAYS</active>
95+
<url>https://oss.sonatype.org/service/local</url>
96+
<snapshotUrl>https://oss.sonatype.org/content/repositories/snapshots/
97+
</snapshotUrl>
98+
<closeRepository>false</closeRepository>
99+
<releaseRepository>false</releaseRepository>
100+
<stagingRepositories>target/staging-deploy</stagingRepositories>
101+
</maven-central>
102+
</nexus2>
103+
</maven>
104+
</deploy>
105+
</jreleaser>
106+
</configuration>
107+
</plugin>
108+
</plugins>
109+
</build>
110+
</profile>
111+
</profiles>
99112

100113
<developers>
101114
<developer>

0 commit comments

Comments
 (0)