Skip to content

Commit 7259b17

Browse files
authored
Configure snapshot release via Central Portal (#262)
1 parent 52a5f12 commit 7259b17

File tree

3 files changed

+138
-22
lines changed

3 files changed

+138
-22
lines changed

.github/workflows/build.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,28 @@ jobs:
6666
else
6767
exit 1
6868
fi
69+
70+
deploy-snapshot:
71+
runs-on: ubuntu-latest
72+
needs: build
73+
if: github.ref == 'refs/heads/main'
74+
75+
steps:
76+
- uses: actions/checkout@v4
77+
- name: Setup JDK
78+
uses: actions/setup-java@v4
79+
with:
80+
distribution: 'temurin'
81+
java-version: '21'
82+
cache: 'maven'
83+
server-id: central
84+
server-username: CENTRAL_USERNAME
85+
server-password: CENTRAL_PASSWORD
86+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
87+
88+
- name: Deploy Snapshot
89+
run: mvn -B --no-transfer-progress -Pmaven-central-release -DskipTests=true deploy
90+
env:
91+
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
92+
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
93+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

pom.xml

Lines changed: 111 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,18 @@
1313
<maven.compiler.target>1.8</maven.compiler.target>
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1515

16-
<vavrVersion>0.10.6</vavrVersion>
17-
<fasterxmlVersion>2.13.5</fasterxmlVersion>
18-
<junitJupiterVersion>5.12.2</junitJupiterVersion>
19-
<assertjVersion>3.27.3</assertjVersion>
20-
<jaxbVersion>2.3.1</jaxbVersion>
21-
<javapoetVersion>1.13.0</javapoetVersion>
16+
<maven.javadoc.version>3.11.2</maven.javadoc.version>
17+
<maven.release.version>3.1.1</maven.release.version>
18+
<maven.source.version>3.3.1</maven.source.version>
19+
<maven.gpg.version>3.2.7</maven.gpg.version>
20+
<maven.central.publishing.version>0.7.0</maven.central.publishing.version>
21+
22+
<vavr.version>0.10.6</vavr.version>
23+
<fasterxml.version>2.13.5</fasterxml.version>
24+
<junit.jupiter.version>5.12.2</junit.jupiter.version>
25+
<assertj.version>3.27.3</assertj.version>
26+
<jaxb.version>2.3.1</jaxb.version>
27+
<javapoet.version>1.13.0</javapoet.version>
2228
</properties>
2329

2430
<repositories>
@@ -38,91 +44,91 @@
3844
<dependency>
3945
<groupId>io.vavr</groupId>
4046
<artifactId>vavr</artifactId>
41-
<version>${vavrVersion}</version>
47+
<version>${vavr.version}</version>
4248
</dependency>
4349

4450
<dependency>
4551
<groupId>com.fasterxml.jackson.core</groupId>
4652
<artifactId>jackson-databind</artifactId>
47-
<version>${fasterxmlVersion}</version>
53+
<version>${fasterxml.version}</version>
4854
</dependency>
4955

5056
<!-- Test dependencies -->
5157
<dependency>
5258
<groupId>org.junit.jupiter</groupId>
5359
<artifactId>junit-jupiter-api</artifactId>
54-
<version>${junitJupiterVersion}</version>
60+
<version>${junit.jupiter.version}</version>
5561
<scope>test</scope>
5662
</dependency>
5763

5864
<dependency>
5965
<groupId>org.junit.jupiter</groupId>
6066
<artifactId>junit-jupiter-engine</artifactId>
61-
<version>${junitJupiterVersion}</version>
67+
<version>${junit.jupiter.version}</version>
6268
<scope>test</scope>
6369
</dependency>
6470

6571
<dependency>
6672
<groupId>org.assertj</groupId>
6773
<artifactId>assertj-core</artifactId>
68-
<version>${assertjVersion}</version>
74+
<version>${assertj.version}</version>
6975
<scope>test</scope>
7076
</dependency>
7177

7278
<dependency>
7379
<groupId>javax.xml.bind</groupId>
7480
<artifactId>jaxb-api</artifactId>
75-
<version>${jaxbVersion}</version>
81+
<version>${jaxb.version}</version>
7682
<scope>test</scope>
7783
</dependency>
7884

7985
<dependency>
8086
<groupId>com.squareup</groupId>
8187
<artifactId>javapoet</artifactId>
82-
<version>${javapoetVersion}</version>
88+
<version>${javapoet.version}</version>
8389
<scope>test</scope>
8490
</dependency>
8591

8692
<dependency>
8793
<groupId>com.fasterxml.jackson.module</groupId>
8894
<artifactId>jackson-module-jaxb-annotations</artifactId>
89-
<version>${fasterxmlVersion}</version>
95+
<version>${fasterxml.version}</version>
9096
<scope>test</scope>
9197
</dependency>
9298
<dependency>
9399
<groupId>com.fasterxml.jackson.dataformat</groupId>
94100
<artifactId>jackson-dataformat-csv</artifactId>
95-
<version>${fasterxmlVersion}</version>
101+
<version>${fasterxml.version}</version>
96102
<scope>test</scope>
97103
</dependency>
98104
<dependency>
99105
<groupId>com.fasterxml.jackson.dataformat</groupId>
100106
<artifactId>jackson-dataformat-xml</artifactId>
101-
<version>${fasterxmlVersion}</version>
107+
<version>${fasterxml.version}</version>
102108
<scope>test</scope>
103109
</dependency>
104110
<dependency>
105111
<groupId>com.fasterxml.jackson.datatype</groupId>
106112
<artifactId>jackson-datatype-joda</artifactId>
107-
<version>${fasterxmlVersion}</version>
113+
<version>${fasterxml.version}</version>
108114
<scope>test</scope>
109115
</dependency>
110116
<dependency>
111117
<groupId>com.fasterxml.jackson.datatype</groupId>
112118
<artifactId>jackson-datatype-jsr310</artifactId>
113-
<version>${fasterxmlVersion}</version>
119+
<version>${fasterxml.version}</version>
114120
<scope>test</scope>
115121
</dependency>
116122
<dependency>
117123
<groupId>com.fasterxml.jackson.datatype</groupId>
118124
<artifactId>jackson-datatype-jdk8</artifactId>
119-
<version>${fasterxmlVersion}</version>
125+
<version>${fasterxml.version}</version>
120126
<scope>test</scope>
121127
</dependency>
122128
<dependency>
123129
<groupId>com.fasterxml.jackson.module</groupId>
124130
<artifactId>jackson-module-scala_2.11</artifactId>
125-
<version>${fasterxmlVersion}</version>
131+
<version>${fasterxml.version}</version>
126132
<scope>test</scope>
127133
</dependency>
128134
</dependencies>
@@ -147,6 +153,91 @@
147153
<useModulePath>false</useModulePath>
148154
</configuration>
149155
</plugin>
156+
157+
<plugin>
158+
<groupId>org.apache.maven.plugins</groupId>
159+
<artifactId>maven-javadoc-plugin</artifactId>
160+
<version>${maven.javadoc.version}</version>
161+
<executions>
162+
<execution>
163+
<id>attach-javadocs</id>
164+
<goals>
165+
<goal>jar</goal>
166+
</goals>
167+
</execution>
168+
</executions>
169+
<configuration>
170+
<failOnWarnings>false</failOnWarnings>
171+
<failOnError>true</failOnError>
172+
</configuration>
173+
</plugin>
174+
175+
<plugin>
176+
<groupId>org.apache.maven.plugins</groupId>
177+
<artifactId>maven-release-plugin</artifactId>
178+
<version>${maven.release.version}</version>
179+
<configuration>
180+
<tagNameFormat>v@{project.version}</tagNameFormat>
181+
<arguments>${arguments} -Pmaven-central-release</arguments>
182+
</configuration>
183+
</plugin>
150184
</plugins>
151185
</build>
186+
187+
<profiles>
188+
<profile>
189+
<id>maven-central-release</id>
190+
<build>
191+
<plugins>
192+
<plugin>
193+
<groupId>org.apache.maven.plugins</groupId>
194+
<artifactId>maven-source-plugin</artifactId>
195+
<version>${maven.source.version}</version>
196+
<executions>
197+
<execution>
198+
<id>attach-sources</id>
199+
<goals>
200+
<goal>jar-no-fork</goal>
201+
</goals>
202+
</execution>
203+
</executions>
204+
</plugin>
205+
<plugin>
206+
<groupId>org.apache.maven.plugins</groupId>
207+
<artifactId>maven-gpg-plugin</artifactId>
208+
<version>${maven.gpg.version}</version>
209+
<executions>
210+
<execution>
211+
<id>sign-artifacts</id>
212+
<phase>verify</phase>
213+
<goals>
214+
<goal>sign</goal>
215+
</goals>
216+
<configuration>
217+
<gpgArguments>
218+
<arg>--pinentry-mode</arg>
219+
<arg>loopback</arg>
220+
</gpgArguments>
221+
</configuration>
222+
</execution>
223+
</executions>
224+
</plugin>
225+
226+
<plugin>
227+
<groupId>org.sonatype.central</groupId>
228+
<artifactId>central-publishing-maven-plugin</artifactId>
229+
<version>${maven.central.publishing.version}</version>
230+
<extensions>true</extensions>
231+
<configuration>
232+
<publishingServerId>central</publishingServerId>
233+
<centralSnapshotsUrl>https://central.sonatype.com/repository/maven-snapshots/
234+
</centralSnapshotsUrl>
235+
<autoPublish>true</autoPublish>
236+
</configuration>
237+
</plugin>
238+
</plugins>
239+
</build>
240+
</profile>
241+
</profiles>
242+
152243
</project>

src/main/java/io/vavr/jackson/datatype/serialize/UnwrappingOptionSerializer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434

3535
/**
3636
* Serializer for {@link Option} that unwraps the value if it is defined and the property is annotated with {@code @JsonUnwrapped}.
37-
* <p/>
37+
*
3838
* Note that {@code Option} values of other Vavr types like {@link io.vavr.control.Try}, {@link Either}, etc are not supported
3939
* due to {@link com.fasterxml.jackson.annotation.JsonUnwrapped} only supports Java beans.
40-
* <p/>
40+
*
4141
* Delegates the unwrapping to a {@link com.fasterxml.jackson.databind.ser.impl.UnwrappingBeanSerializer}
4242
* since to support unwrapping requires to serialize only the fields instead of the whole object
4343
* but that is an internal {@link BeanSerializerBase} function and therefore not available here.

0 commit comments

Comments
 (0)