Skip to content

Commit 888fa2a

Browse files
committed
Stage snapshot deployments similar to how we do in our other projects
Motivation: The documented approach do not work, so instead lets follow what we do in our other projects and use the staging plugin. Modification: Deploy snapshots via local staging instead. Result: Maybe this works.
1 parent 46ff134 commit 888fa2a

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

.github/workflows/ci-deploy.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,11 @@ jobs:
5858
restore-keys: |
5959
deploy-cache-m2-repository-
6060
61+
- name: Create local staging directory
62+
run: mkdir -p ~/local-staging
63+
64+
- name: Stage snapshots to local staging directory
65+
run: ./mvnw -B -ntp -Pstage-snapshot clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -DaltStagingDirectory=$HOME/local-staging
66+
6167
- name: Deploy project
62-
run: ./mvnw --file pom.xml clean package org.apache.maven.plugins:maven-deploy-plugin:deploy
68+
run: ./mvnw -B -X -ntp --file pom.xml -Pstage-snapshot org.sonatype.plugins:nexus-staging-maven-plugin:deploy-staged -DaltStagingDirectory=$HOME/local-staging

pom.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,4 +273,27 @@
273273
</plugin>
274274
</plugins>
275275
</build>
276+
277+
<profiles>
278+
<profile>
279+
<id>stage-snapshot</id>
280+
<properties>
281+
<skipTests>true</skipTests>
282+
</properties>
283+
<build>
284+
<plugins>
285+
<plugin>
286+
<groupId>org.sonatype.plugins</groupId>
287+
<artifactId>nexus-staging-maven-plugin</artifactId>
288+
<version>1.7.0</version>
289+
<configuration>
290+
<serverId>central-portal-snapshots</serverId>
291+
<nexusUrl>https://central.sonatype.com/repository/maven-snapshots</nexusUrl>
292+
<skipRemoteStaging>true</skipRemoteStaging>
293+
</configuration>
294+
</plugin>
295+
</plugins>
296+
</build>
297+
</profile>
298+
</profiles>
276299
</project>

0 commit comments

Comments
 (0)