Quarkus gradle plugin classpath exclude problem

32 views Asked by At

I´m having a issue trying exclude some dependency/version (H2) from plugin 'io.quarkus'. I need use strictly com.h2database:h2:2.1.214, but plugin 'io.quarkus' has a com.h2database:h2:2.2.224.

I´m using:

  • Gradle wrapper 8.6
  • Quarkus platform & plugin: 3.8.2

build.gradle

plugins {
    id 'java'
    id 'io.quarkus' 
    id 'org.owasp.dependencycheck' version '9.0.9'

}

configurations {
    all {
        resolutionStrategy {
            force 'com.h2database:h2:2.1.214'
        }
    }
}

dependencies {
  
    implementation("com.h2database:h2") {
        version {
            strictly('2.1.214')
        }
    }    
}

./gradlew buildEnvironment


> Task :buildEnvironment

------------------------------------------------------------
Root project 'test'
------------------------------------------------------------

classpath
+--- io.quarkus:io.quarkus.gradle.plugin:3.8.2
|    \--- io.quarkus:gradle-application-plugin:3.8.2
|         +--- io.quarkus:quarkus-bom:3.8.2
               ...
|         |    **+--- com.h2database:h2:2.2.224 (c)**
|         |    ...

\--- org.owasp.dependencycheck:org.owasp.dependencycheck.gradle.plugin:9.0.9
     \--- org.owasp:dependency-check-gradle:9.0.9
          +--- org.owasp:dependency-check-core:9.0.9
          .........
          **|    +--- com.h2database:h2:2.1.214 -> 2.2.224**

Any ideas on how to force the use of com.h2database:h2:2.1.214?

Thanks in advance!

EDIT:

I found a solution:

buildscript {
    configurations.classpath {
      resolutionStrategy {
            force 'com.h2database:h2:2.1.214'            
        }
  }
}

plugins {
    id 'java'
    id "io.quarkus"
    id "org.owasp.dependencycheck" version "9.0.9"
}   

...
0

There are 0 answers