Skip to content

Commit a88a6b3

Browse files
committed
mega-melt: force matching version of the enforcer
Otherwise, some n5 component builds fail because they pin to a too-old version.
1 parent 9e183c3 commit a88a6b3

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

tests/run.sh

+19-1
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,26 @@ kotlinVersion=$(
152152
mvn -B -U -q -Denforcer.skip=true -Dexec.executable=echo \
153153
-Dexec.args='${kotlin.version}' --non-recursive validate exec:exec 2>&1 |
154154
head -n1 | sed 's;\(.\[[0-9]m\)*;;') &&
155+
# TEMP: Also fix the version of maven-enforcer-plugin, to prevent n5 from
156+
# overriding it with a too-old version. Even though we pass enforcer.skip,
157+
# so that the enforcer plugin does not actually do any checking, this version
158+
# mismatch still triggers a problem:
159+
#
160+
# [ERROR] Failed to execute goal
161+
# org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:enforce
162+
# (enforce-rules) on project n5-blosc: Unable to parse configuration of
163+
# mojo org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:enforce
164+
# for parameter banDuplicateClasses: Cannot create instance of interface
165+
# org.apache.maven.enforcer.rule.api.EnforcerRule:
166+
# org.apache.maven.enforcer.rule.api.EnforcerRule.<init>() -> [Help 1]
167+
#
168+
# Once n5 components stop doing that version pin, we can remove this here.
169+
enforcerVersion=$(
170+
mvn -B -U -q -Denforcer.skip=true -Dexec.executable=echo \
171+
-Dexec.args='${maven-enforcer-plugin.version}' --non-recursive validate exec:exec 2>&1 |
172+
head -n1 | sed 's;\(.\[[0-9]m\)*;;') &&
155173
mv -f "$buildScript" "$buildScriptTemp" &&
156-
sed -E "s;mvn -Denforcer.skip;& -Dkotlin.version=$kotlinVersion;" "$buildScriptTemp" > "$buildScript" &&
174+
sed -E "s;mvn -Denforcer.skip;& -Dmaven-enforcer-plugin.version=$enforcerVersion -Dkotlin.version=$kotlinVersion;" "$buildScriptTemp" > "$buildScript" &&
157175

158176
chmod +x "$buildScript" &&
159177
rm "$buildScriptTemp" ||

0 commit comments

Comments
 (0)