cqframework / clinical_quality_language

Clinical Quality Language (CQL) is an HL7 specification for the expression of clinical knowledge that can be used within both the Clinical Decision Support (CDS) and Clinical Quality Measurement (CQM) domains. This repository contains complementary tooling in support of that specification.
https://confluence.hl7.org/display/CDS/Clinical+Quality+Language
Apache License 2.0
251 stars 121 forks source link

Build Exceptions #1310

Closed MatthewDynamic closed 6 months ago

MatthewDynamic commented 6 months ago

I am attempting to build from source (using branch master) following the directions located here: https://github.com/cqframework/clinical_quality_language/blob/master/Src/java/README.md

But I am receiving the following exception:

>> gradlew build
> Task :buildSrc:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':buildSrc:compileJava'.
> Could not resolve all files for configuration ':buildSrc:compileClasspath'.
   > Could not resolve com.diffplug.spotless:spotless-plugin-gradle:6.23.3.
     Required by:
         project :buildSrc
      > No matching variant of com.diffplug.spotless:spotless-plugin-gradle:6.23.3 was found. The consumer was configured to find a library for use during compile-time, compatible with Java 8, preferably not packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.5' but:
          - Variant 'apiElements' capability com.diffplug.spotless:spotless-plugin-gradle:6.23.3 declares a library for use during compile-time, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component, compatible with Java 11 and the consumer needed a component, compatible with Java 8
              - Other compatible attributes:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.5')
          - Variant 'javadocElements' capability com.diffplug.spotless:spotless-plugin-gradle:6.23.3 declares a component for use during runtime, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them preferably not packaged as a jar)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.5')
          - Variant 'runtimeElements' capability com.diffplug.spotless:spotless-plugin-gradle:6.23.3 declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component, compatible with Java 11 and the consumer needed a component, compatible with Java 8
              - Other compatible attributes:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.5')
          - Variant 'sourcesElements' capability com.diffplug.spotless:spotless-plugin-gradle:6.23.3 declares a component for use during runtime, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them preferably not packaged as a jar)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.5')

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 4s
3 actionable tasks: 1 executed, 2 from cache

According to README, JDK 1.8 should be used. My path and javahome env varaible are set so that java -version is responding:

java version "1.8.0_391"
Java(TM) SE Runtime Environment (build 1.8.0_391-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.391-b13, mixed mode)

gradlew :cql-to-elm-cli:run produces similar errors.

I do not know enough about gradle or the java ecosystem to do very much debugging. But I believe I have followed the directions clearly. Am I on the correct branch?

Any advice would be greatly appreciated.

Thank you, Matthew Dugal

JPercival commented 6 months ago

Readme out of date, a recent JDK is required. Currently targeting JDK 11, expected to move to JDK 17 in August of 2024.

JPercival commented 6 months ago

Readme updated to specify 11.

MatthewDynamic commented 6 months ago

I tried multiple versions and got various errors I was not able to figure out. But I did not try 11. Thank you for the update.

JPercival commented 6 months ago

If that doesn't work out for you let me know and we'll reopen the issue. :)