gradle-node-plugin icon indicating copy to clipboard operation
gradle-node-plugin copied to clipboard

download feature breaks settings repository

Open tg-freigmbh opened this issue 1 year ago • 3 comments

This plugin offers a functionality to download Node.js. If this functionality is used this plugin registers a new ivy repository for gradle. This doesnt work very well if a user defines their repositories in settings.gradle.kts. Depending on the value chosen for: org.gradle.api.initialization.resolve.RepositoryMode this will mean one of the following:

  1. PREFER_PROJECT: The registration of this Plugin will work, but gradle will drop previously working repositories defined in settings.gradle
  2. PREFER_SETTINGS: This registration of this Plugin will be ignored
  3. FAIL_ON_PROJECT_REPOS: The build will fail.

tg-freigmbh avatar Apr 02 '25 12:04 tg-freigmbh

That's absolutely correct, the repository mode is working exactly as intended as it lets you configure this This is covered in our FAQ https://github.com/node-gradle/gradle-node-plugin/blob/main/docs/faq.md#is-this-plugin-compatible-with-centralized-repositories-declaration

deepy avatar Apr 02 '25 12:04 deepy

many thanks I admitedly have not read this :) As far as I understand gradle there is unfortunately no way to print a warning when somehting like this happens so I guess we will just implement linked solution. Thank you!

tg-freigmbh avatar Apr 02 '25 12:04 tg-freigmbh

I feel like there's a 4th mode missing, but of the 3 that exists I find FAIL_ON_PROJECT_REPOS is the most appropriate setting, as all the others allow for sneaky issues to stay hidden

deepy avatar Apr 02 '25 13:04 deepy