snyk / snyk-gradle-plugin

Basic Snyk CLI plugin for Gradle support
Other
25 stars 19 forks source link

Parallel flag not supported in Gradle multi multi project builds - Results in poor performance in large projects #214

Closed ronanbrowne closed 11 months ago

ronanbrowne commented 2 years ago

Expected behaviour

Gradles parallel flag to be supported and Underlying Gradle Task is executed in a parallel fashion, Most enterprise projects which use Gradle are large multi project builds as such running Snyk-test on them is a time consuming task, For example one large legacy project takes upwards of 20 - 30 minutes to complete a scan.

Supporting the parallel flag would greatly assist here as this allows Gradle to execute the same tasks in submodules in a parallel fashion.

Actual behaviour

Gradle -parallel flag not supported throws a error

Steps to reproduce

Execute the following against any gradle project which is a mult project build

snyk test --all-projects -- -parallel

The following error will be thrown

15:42:11  * Where:
15:42:11  Initialization script '/tmp/tmp-3648-NkSbzlUnvQH8--init.gradle' line: 222
15:42:11  
15:42:11  * What went wrong:
15:42:11  Execution failed for task ':processors:snykResolvedDepsJson'.
15:42:11  > java.util.ConcurrentModificationException (no error message)

If applicable, please append the --debug flag on your command and include the output here **ensuring to remove any sensitive/personal details or tokens.