Skip to content

Commit 00fb3c1

Browse files
committed
Fix pmd error due to signing jars
jar signing plugin and pmd plugin don't work well together with multi-module builds: we end up with partially signed packages - one part is signed from the previous module, but for the current module only target/classes is on the auxclasspath which is not signed. If there are classes in the same packages (such as test classes) this will fail with SecurityException: ... signer information does not match signer information of other classes in the same package For now, we run the builds twice - first without signing and then with signing (but without pmd).
1 parent 7944eef commit 00fb3c1

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

.ci/build.sh

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,17 @@ function snapshot_build() {
5959
pmd_ci_log_group_start "Snapshot Build: ${PMD_CI_MAVEN_PROJECT_VERSION}"
6060
pmd_ci_log_info "This is a snapshot build on branch ${PMD_CI_BRANCH} (version: ${PMD_CI_MAVEN_PROJECT_VERSION})"
6161

62-
# Build
63-
xvfb-run --auto-servernum ./mvnw clean verify --show-version --errors --batch-mode \
64-
--no-transfer-progress \
62+
# Build 1 - without signing but with tests
63+
xvfb-run --auto-servernum ./mvnw clean verify \
64+
--show-version --errors --batch-mode --no-transfer-progress \
65+
--toolchains .ci/files/toolchains.xml
66+
67+
# Build 2 - with signing, but skipping tests, pmd, checkstyle
68+
xvfb-run --auto-servernum ./mvnw clean verify \
69+
--show-version --errors --batch-mode --no-transfer-progress \
6570
--toolchains .ci/files/toolchains.xml \
66-
--activate-profiles sign
71+
--activate-profiles sign \
72+
-Dpmd.skip=true -DskipTests -Dcheckstyle.skip
6773

6874
# Upload update site to sourceforge
6975
local qualifiedVersion
@@ -110,11 +116,18 @@ function release_build() {
110116
pmd_ci_log_group_start "Release Build: ${PMD_CI_MAVEN_PROJECT_VERSION}"
111117
pmd_ci_log_info "This is a release build for tag ${PMD_CI_TAG} (version: ${PMD_CI_MAVEN_PROJECT_VERSION})"
112118

113-
# Build
114-
xvfb-run --auto-servernum ./mvnw clean verify --show-version --errors --batch-mode \
115-
--no-transfer-progress \
119+
# Build 1 - without signing but with tests
120+
xvfb-run --auto-servernum ./mvnw clean verify \
121+
--show-version --errors --batch-mode --no-transfer-progress \
122+
--toolchains .ci/files/toolchains.xml
123+
124+
# Build 2 - with signing, but skipping tests, pmd, checkstyle
125+
xvfb-run --auto-servernum ./mvnw clean verify \
126+
--show-version --errors --batch-mode --no-transfer-progress \
116127
--toolchains .ci/files/toolchains.xml \
117-
--activate-profiles sign
128+
--activate-profiles sign \
129+
-Dpmd.skip=true -DskipTests -Dcheckstyle.skip
130+
118131
pmd_ci_log_group_end
119132

120133
pmd_ci_log_group_start "Update Github Releases"

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@
280280
</execution>
281281
</executions>
282282
<configuration>
283-
<linkXRef>true</linkXRef>
283+
<linkXRef>false</linkXRef>
284284
<minimumTokens>100</minimumTokens>
285285
<targetJdk>${java.version}</targetJdk>
286286
<rulesets>

0 commit comments

Comments
 (0)