Skip to content

Commit fe4f6b1

Browse files
fix: Build producer_with_xml separately to avoid classloader conflict
The SCC Maven plugin with extensions=true causes a BasicAuthCache ClassCastException when too many modules accumulate classrealms in a single reactor build. Pre-resolving plugins doesn't help because the issue is Maven's classrealm architecture, not JAR caching. Fix: exclude producer_with_xml from the reactor and build it in its own Maven invocation in runMavenBuilds.sh. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4a67f8f commit fe4f6b1

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

.github/workflows/maven.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,5 @@ jobs:
2424
- name: Pre-resolve SCC plugin to avoid classloader conflict
2525
run: |
2626
cd common && ./mvnw dependency:resolve-plugins -B && cd ..
27-
./mvnw dependency:resolve-plugins -Ptest -B || true
2827
- name: Build with Maven
2928
run: ./scripts/runMavenBuilds.sh

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
<module>producer_with_webtestclient_restdocs</module>
132132
<module>producer_with_dsl_restdocs</module>
133133
<!-- <module>producer_with_spock</module>--> <!-- TODO: Spock Spring is broken -->
134-
<module>producer_with_xml</module>
134+
<!-- <module>producer_with_xml</module>--> <!-- Built separately: SCC plugin classloader conflict in reactor -->
135135
<module>producer_with_latest_2_2_features</module>
136136
<!-- <module>producer_kotlin_ftw</module>--><!-- Kotlin issues -->
137137
<module>producer_java</module>

scripts/runMavenBuilds.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,18 @@ function build_maven() {
3636
else
3737
./mvnw clean install -Ptest -B
3838
fi
39+
40+
# Build producer_with_xml separately to avoid SCC plugin classloader
41+
# conflict (BasicAuthCache ClassCastException) that occurs when too many
42+
# modules with extensions=true accumulate classrealms in a single reactor.
43+
echo -e "\n\nBuilding producer_with_xml separately\n\n"
44+
cd ${ROOT}/producer_with_xml
45+
if [[ "${SKIP_TESTS}" == "true" ]]; then
46+
./mvnw clean install -B -DskipTests -DfailIfNoTests=false -Dspring.cloud.contract.verifier.skip=true -Dspring.cloud.contract.verifier.jar.skip=true
47+
else
48+
./mvnw clean install -B
49+
fi
50+
cd ${ROOT}
3951
}
4052

4153
cat <<'EOF'

0 commit comments

Comments
 (0)