dependency-check-gradle icon indicating copy to clipboard operation
dependency-check-gradle copied to clipboard

Kotlin 2.0 and test groups problem

Open BrunoJAzevedo opened this issue 1 year ago • 3 comments
trafficstars

Hello,

I'm using this plugin for the first time on an Android App and I noticed something

When using Kotlin version 2.0 and skipTestGroups=false I have the following error:

Cannot change dependencies of dependency configuration ':debugAndroidTestCompileClasspath' after it has been included in dependency resolution. Use 'defaultDependencies' instead of 'beforeResolve' to specify default dependencies for a configuration.

I've been able to "fix" this either changing Kotlin version to 1.9.24 or still use Kotlin 2.0 but skipping the test groups skipTestGroups=true

Currently I'm using version 9.2.0 of the dependency check.

Is there something that I should be doing different on how to use Kotlin 2.0 and not skipping the tests groups?

Thank you in advance!

BrunoJAzevedo avatar Jun 04 '24 14:06 BrunoJAzevedo

Hi @jeremylong !

We also face issues with Gradle 8.5 / Kotlin 2.0.0 that can be "fixed" by downgrading to 1.9.24.

In our case we get false positives for quite old CVEs or CVEs that don't affect us. Are there any known limitations / bugs using dependency-check with Kotlin 2.0.0?

Thanks!

ccudennec-otto avatar Jun 07 '24 12:06 ccudennec-otto

report FP here.

Regarding the test groups - I have not had time to look into this. Do you have a sample project that causes the issue?

jeremylong avatar Nov 22 '24 11:11 jeremylong

We also face issues with Gradle 8.5 / Kotlin 2.0.0 that can be "fixed" by downgrading to 1.9.24.

For me it looks like Kotlin 2.0.21 and Dependency Check 11.1.0 works together. Thanks! 👍

ccudennec-otto avatar Nov 22 '24 14:11 ccudennec-otto

no sample project has been provided. If this is still an issue you can re-open this or create a new issue. Please include a project to replicate the problem.

jeremylong avatar Oct 10 '25 21:10 jeremylong