From 76e5aa5d0e25a108fa1d0d54a7c2fdb409993512 Mon Sep 17 00:00:00 2001 From: Dhruv Gupta Date: Thu, 8 Oct 2026 16:49:56 -0400 Subject: [PATCH] Fix CI build: pin Maven 3.9 and fix ambiguous query matcher in test The ubuntu-24.04 runner image now ships Maven 3.10.0, which cannot build the effective model of miredot-plugin 2.4.0: its toolsjar profile is no longer activated, so the com.sun:tools systemPath stays ${toolsjar} and plugin resolution fails before compilation. Install Maven 3.9.16 in the CI and release workflows instead of using the runner's Maven. CDMResultsAnalysisRunnerTest stubbed JdbcTemplate.query with any() as the second argument, which javac 8 rejects as ambiguous between the Object[] and PreparedStatementSetter overloads. Match PreparedStatementSetter, which is the overload CDMResultsAnalysisRunner calls. --- .github/workflows/ci.yaml | 7 +++++++ .github/workflows/release.yaml | 7 +++++++ .../ohdsi/webapi/report/CDMResultsAnalysisRunnerTest.java | 3 ++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 57a6318cf5..b936b3eee4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -29,6 +29,13 @@ jobs: with: java-version: 8 + # The miredot plugin's POM cannot be resolved by Maven 3.10+ (${toolsjar} is + # never set), so pin the last working Maven 3.9 release instead of the runner's. + - name: Set up Maven + run: | + curl -fsSL https://archive.apache.org/dist/maven/maven-3/3.9.16/binaries/apache-maven-3.9.16-bin.tar.gz | tar xz -C "$RUNNER_TEMP" + echo "$RUNNER_TEMP/apache-maven-3.9.16/bin" >> "$GITHUB_PATH" + - name: Maven cache uses: actions/cache@v4 with: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5c029bac62..1686431af3 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -25,6 +25,13 @@ jobs: with: java-version: 8 + # The miredot plugin's POM cannot be resolved by Maven 3.10+ (${toolsjar} is + # never set), so pin the last working Maven 3.9 release instead of the runner's. + - name: Set up Maven + run: | + curl -fsSL https://archive.apache.org/dist/maven/maven-3/3.9.16/binaries/apache-maven-3.9.16-bin.tar.gz | tar xz -C "$RUNNER_TEMP" + echo "$RUNNER_TEMP/apache-maven-3.9.16/bin" >> "$GITHUB_PATH" + - name: Maven cache uses: actions/cache@v4 with: diff --git a/src/test/java/org/ohdsi/webapi/report/CDMResultsAnalysisRunnerTest.java b/src/test/java/org/ohdsi/webapi/report/CDMResultsAnalysisRunnerTest.java index 90aad7c543..cb6d33a4ce 100644 --- a/src/test/java/org/ohdsi/webapi/report/CDMResultsAnalysisRunnerTest.java +++ b/src/test/java/org/ohdsi/webapi/report/CDMResultsAnalysisRunnerTest.java @@ -15,6 +15,7 @@ import org.ohdsi.webapi.source.SourceDaimon; import org.springframework.dao.DataAccessResourceFailureException; import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.jdbc.core.PreparedStatementSetter; import org.springframework.jdbc.core.RowMapper; /** @@ -47,7 +48,7 @@ public void setUp() { public void getDrilldown_propagatesQueryFailureInsteadOfReturningEmptyResult() { // Simulate a SQL failure during the drilldown (e.g. unreachable results schema) - when(jdbcTemplate.query(anyString(), any(), any(RowMapper.class))) + when(jdbcTemplate.query(anyString(), any(PreparedStatementSetter.class), any(RowMapper.class))) .thenThrow(new DataAccessResourceFailureException("simulated SQL failure")); try {