Skip to content

Commit babb2b6

Browse files
committed
PGP sign content
As we consume directly from Maven Central for third-party dependencies we need to resign content with PGP to allow installation without signing errors. Note that this only works for recent-ish versions of Eclipse. Installing in older versions will cause unsigned content warnings. Users are recommended to use latest/recent Eclipse versions to be fully supported and ISVs are responsible to to maintain and update as needed.
1 parent a782670 commit babb2b6

File tree

2 files changed

+36
-9
lines changed

2 files changed

+36
-9
lines changed

parent/pom.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,23 @@
262262
</execution>
263263
</executions>
264264
</plugin>
265+
<plugin>
266+
<groupId>org.eclipse.tycho</groupId>
267+
<artifactId>tycho-gpg-plugin</artifactId>
268+
<version>${tycho.version}</version>
269+
<executions>
270+
<execution>
271+
<id>pgpsigner</id>
272+
<goals>
273+
<goal>sign-p2-artifacts</goal>
274+
</goals>
275+
<configuration>
276+
<keyname>F5CBCFD82F07D82E</keyname>
277+
<skipIfJarsigned>false</skipIfJarsigned>
278+
</configuration>
279+
</execution>
280+
</executions>
281+
</plugin>
265282
</plugins>
266283
</build>
267284
</profile>

scripts/jenkins/builds.Jenkinsfile

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,27 @@ pipeline {
1515
}
1616

1717
stages {
18+
stage('initialize PGP') {
19+
steps {
20+
withCredentials([file(credentialsId: 'secret-subkeys.asc', variable: 'KEYRING')]) {
21+
sh 'gpg --batch --import "${KEYRING}"'
22+
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'
23+
}
24+
}
25+
}
1826
stage('Build') {
1927
steps {
20-
21-
sh "mvn \
22-
--batch-mode \
23-
--show-version \
24-
clean verify \
25-
-P production \
26-
-Dmaven.repo.local=/home/jenkins/.m2/repository \
27-
--settings /home/jenkins/.m2/settings.xml \
28-
"
28+
withCredentials([string(credentialsId: 'gpg-passphrase', variable: 'KEYRING_PASSPHRASE')]) {
29+
sh "mvn \
30+
--batch-mode \
31+
--show-version \
32+
clean verify \
33+
-Dgpg.passphrase="${KEYRING_PASSPHRASE}" \
34+
-P production \
35+
-Dmaven.repo.local=/home/jenkins/.m2/repository \
36+
--settings /home/jenkins/.m2/settings.xml \
37+
"
38+
}
2939
}
3040
}
3141
stage('Upload') {

0 commit comments

Comments
 (0)