Itiviti / gradle-nuget-plugin

Executes NuGet from a gradle build
Apache License 2.0
22 stars 29 forks source link

Collision when downloading nuget in multiple sub projects #92

Open afischer-opentext-com opened 1 year ago

afischer-opentext-com commented 1 year ago

Hi,

using version 2.23

I have a gradle project with two sub projects and both use the nuget plugin. From time to time I observe the situation that after server maintenance one of the related nugetRestore tasks fails while the other one succeeds. Subsequent builds succeed then.

This suggests that the download of the nuget executable into the Gradle cache has a synchronization issue or some check for presence of the executable may lead to unexpected results.

Is it possible that the check for the nuget executable tests only for existence of the file but not for complete download of it?

afischer-opentext-com commented 1 year ago

It seems to me that indeed parallel jobs might lead to issues as there is no synchronization: https://github.com/Itiviti/gradle-nuget-plugin/blob/045fc691a704cda3fd6afcc43acc7e820a868926/src/main/groovy/com/ullink/BaseNuGet.groovy#L79 I do not know enought about gradle to provide a proper solution for that. The workaround is to define an explicit dependency which technically does not exist.