Skip to content

Commit 17d55ac

Browse files
committed
[#286] More snapshot publishing updates
1 parent 649c0a2 commit 17d55ac

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

ci/snapshot-publish/Jenkinsfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ pipeline {
3434
stages {
3535
stage('Publish Snapshot to Maven Central') {
3636
steps {
37-
script {
38-
sh "./mvnw clean deploy"
37+
withCredentials([file(credentialsId: 'secret-subkeys.asc', variable: 'KEYRING')]) {
38+
sh 'gpg --batch --import "${KEYRING}"'
39+
sh 'for fpr in $(gpg --list-keys --with-colons | awk -F: \'/fpr:/ {print $10}\' | sort -u); do echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key ${fpr} trust; done'
40+
41+
sh "./mvnw clean deploy -Poss-release -Psnapshots -DskipTests=true"
3942
}
4043
}
4144
}

pom.xml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@
282282
<execution>
283283
<id>attach-sources</id>
284284
<goals>
285-
<goal>jar</goal>
285+
<goal>jar-no-fork</goal>
286286
</goals>
287287
</execution>
288288
</executions>
@@ -401,6 +401,25 @@ Use is subject to <a href="{@docRoot}/doc-files/speclicense.html" target="_top">
401401
<enforcer.skip>true</enforcer.skip>
402402
</properties>
403403
</profile>
404+
<profile>
405+
<id>oss-release</id>
406+
<build>
407+
<plugins>
408+
<plugin>
409+
<groupId>org.sonatype.central</groupId>
410+
<artifactId>central-publishing-maven-plugin</artifactId>
411+
<extensions>true</extensions>
412+
<configuration>
413+
<autoPublish>${autoPublish}</autoPublish>
414+
<deploymentName>Jakarta Validation ${project.version}-${maven.build.timestamp}</deploymentName>
415+
<publishingServerId>central</publishingServerId>
416+
<waitUntil>published</waitUntil>
417+
<centralSnapshotsUrl>https://central.sonatype.com/repository/maven-snapshots/</centralSnapshotsUrl>
418+
</configuration>
419+
</plugin>
420+
</plugins>
421+
</build>
422+
</profile>
404423
</profiles>
405424

406425
</project>

0 commit comments

Comments
 (0)