Skip to content

Commit 2dd518e

Browse files
committed
#132 Add snapshot profile to publish snapshots without gpg signing
Signed-off-by: Patrick <patrick.weiss@iteratec.com>
1 parent 140db03 commit 2dd518e

File tree

2 files changed

+61
-37
lines changed

2 files changed

+61
-37
lines changed

.github/workflows/snapshot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
server-password: MAVEN_PASSWORD
3131

3232
- name: Build & Publish to Maven Central
33-
run: mvn -U -B clean deploy # -U: force updates for dependencies, -B: no user input
33+
run: mvn -U -B clean deploy -P snapshot # -U: force updates for dependencies, -B: no user input
3434
env:
3535
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
3636
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}

pom.xml

Lines changed: 60 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -193,36 +193,25 @@
193193
<plugin>
194194
<groupId>org.sonatype.central</groupId>
195195
<artifactId>central-publishing-maven-plugin</artifactId>
196-
<version>0.8.0</version>
197-
<extensions>true</extensions>
198-
<configuration>
199-
<publishingServerId>central</publishingServerId>
200-
<tokenAuth>true</tokenAuth>
201-
<autoPublish>true</autoPublish>
202-
<waitUntil>published</waitUntil>
203-
</configuration>
204196
</plugin>
205197
<plugin>
206198
<groupId>org.apache.maven.plugins</groupId>
207199
<artifactId>maven-gpg-plugin</artifactId>
208-
<version>3.1.0</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-
<!-- This is required to make sure the plugin does not stop asking for -->
218-
<!-- user input on the passphrase -->
219-
<gpgArguments>
220-
<arg>--pinentry-mode</arg>
221-
<arg>loopback</arg>
222-
</gpgArguments>
223-
</configuration>
224-
</execution>
225-
</executions>
200+
</plugin>
201+
<plugin>
202+
<artifactId>maven-release-plugin</artifactId>
203+
<version>3.0.1</version>
204+
</plugin>
205+
</plugins>
206+
</build>
207+
</profile>
208+
<profile>
209+
<id>snapshot</id>
210+
<build>
211+
<plugins>
212+
<plugin>
213+
<groupId>org.sonatype.central</groupId>
214+
<artifactId>central-publishing-maven-plugin</artifactId>
226215
</plugin>
227216
</plugins>
228217
</build>
@@ -232,6 +221,51 @@
232221
<build>
233222
<pluginManagement>
234223
<plugins>
224+
<plugin>
225+
<groupId>org.sonatype.central</groupId>
226+
<artifactId>central-publishing-maven-plugin</artifactId>
227+
<version>0.8.0</version>
228+
<extensions>true</extensions>
229+
<configuration>
230+
<publishingServerId>central</publishingServerId>
231+
<autoPublish>true</autoPublish>
232+
<waitUntil>published</waitUntil>
233+
</configuration>
234+
</plugin>
235+
236+
<plugin>
237+
<groupId>org.apache.maven.plugins</groupId>
238+
<artifactId>maven-gpg-plugin</artifactId>
239+
<version>3.1.0</version>
240+
<executions>
241+
<execution>
242+
<id>sign-artifacts</id>
243+
<phase>verify</phase>
244+
<goals>
245+
<goal>sign</goal>
246+
</goals>
247+
<configuration>
248+
<!-- This is required to make sure the plugin does not stop asking for -->
249+
<!-- user input on the passphrase -->
250+
<gpgArguments>
251+
<arg>--pinentry-mode</arg>
252+
<arg>loopback</arg>
253+
</gpgArguments>
254+
</configuration>
255+
</execution>
256+
</executions>
257+
</plugin>
258+
259+
<plugin>
260+
<artifactId>maven-release-plugin</artifactId>
261+
<version>3.0.1</version>
262+
<configuration>
263+
<checkModificationExcludes>
264+
<checkModificationExclude>mvnw</checkModificationExclude> <!-- skip wrapper -->
265+
</checkModificationExcludes>
266+
</configuration>
267+
268+
</plugin>
235269
<plugin>
236270
<artifactId>maven-compiler-plugin</artifactId>
237271
<version>3.12.1</version>
@@ -286,16 +320,6 @@
286320
</executions>
287321
</plugin>
288322

289-
<plugin>
290-
<artifactId>maven-release-plugin</artifactId>
291-
<version>3.0.1</version>
292-
<configuration>
293-
<checkModificationExcludes>
294-
<checkModificationExclude>mvnw</checkModificationExclude> <!-- skip wrapper -->
295-
</checkModificationExcludes>
296-
</configuration>
297-
</plugin>
298-
299323
<plugin>
300324
<groupId>org.jacoco</groupId>
301325
<artifactId>jacoco-maven-plugin</artifactId>

0 commit comments

Comments
 (0)