christophsturm
04/11/2024, 4:07 PMjoffrey
04/11/2024, 4:20 PMjoffrey
04/11/2024, 4:49 PMrepositories.removeIf { it.name != "maven" }
. If you want to do this more generally, using a dependencyResolutionManagement
block with PREFER_SETTINGS
mode in your settings.gradle.kts
should override Amper's default repos (which are added at the project level):
dependencyResolutionManagement {
repositories {
mavenCentral()
}
repositoriesMode = RepositoriesMode.PREFER_SETTINGS
}
christophsturm
04/11/2024, 6:24 PMThe following dependencies have later milestone versions:
- org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable [1.9.20 -> 1.9.24-786]
<https://kotlinlang.org/>
- org.jetbrains.kotlin:kotlin-serialization-compiler-plugin-embeddable [1.9.20 -> 1.9.24-786]
<https://kotlinlang.org/>
- org.jetbrains.kotlin:kotlin-stdlib [1.9.20 -> 2.0.0-241135-2]
<https://kotlinlang.org/>
- org.jetbrains.kotlin:kotlin-test [1.9.20 -> 2.0.0-241135-2]
<https://kotlinlang.org/>
- org.jetbrains.kotlin:kotlin-test-junit [1.9.20 -> 2.0.0-241135-2]
christophsturm
04/11/2024, 6:35 PM> Configure project :core
Build was configured to prefer settings repositories over project repositories but repository 'MavenRepo' was added by plugin 'org.jetbrains.amper.settings.plugin'
Build was configured to prefer settings repositories over project repositories but repository 'Google' was added by plugin 'org.jetbrains.amper.settings.plugin'
Build was configured to prefer settings repositories over project repositories but repository 'Gradle Central Plugin Repository' was added by plugin 'org.jetbrains.amper.settings.plugin'
Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by plugin 'org.jetbrains.amper.settings.plugin'
Build was configured to prefer settings repositories over project repositories but repository 'maven2' was added by plugin 'org.jetbrains.amper.settings.plugin'
joffrey
04/12/2024, 7:12 AMallprojects
block.christophsturm
04/12/2024, 8:13 AMchristophsturm
04/12/2024, 8:16 AMjoffrey
04/12/2024, 9:19 AMamper could just check if the mode is RepositoriesMode.PREFER_SETTINGS and then not add the repos. that would be perfectThanks for the suggestion! Note that removing default Amper repos may in general break some of Amper's functionality. For instance, people using
settings.compose: enabled
might have problems because compose dependencies might not be found in the user-provided repos. In that sense, the Gradle warning is legitimate.
One option could be to make Amper conditionally add repos only if a feature requires it, but that could have side effects on dependency resolution for users. Imagine removing compose: enabled
and suddenly one of your dependencies cannot be resolved anymore. That might be a bit too surprising.
The idea of opting out of default Amper repos is probably a more suitable option. Amper could provide a setting to do this from module.yaml
(which could be done globally via a template).
In a sense, using PREFER_SETTING
or FAIL_ON_PROJECT_REPOS
modes from Gradle settings could be considered a way to opt out too, as you suggested. We would need to evaluate how surprising that would be. I'll discuss this with the team.joffrey
04/12/2024, 9:25 AMis one goal of amper in its current state (0.2, 0.3) to be usable for small projects and be as good or better as gradle? or is it more just a prototype to try in experiments? if its the former, there are a lot of small things that could be fixed.Amper is still experimental, but it can already be used for several types of projects, and we are trying to provide the best possible experience for the use cases that we support. In that light, what would you like to be fixed? (feel free to open YouTrack issues as well if you want a more formal way to report them)
christophsturm
04/12/2024, 11:37 AMThe following dependencies have later milestone versions:
- junit:junit [4.12 -> 4.13.2]
<http://junit.org>
- org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable [1.9.20 -> 1.9.23]
<https://kotlinlang.org/>
- org.jetbrains.kotlinx:kotlinx-serialization-json [1.5.1 -> 1.6.3]
<https://github.com/Kotlin/kotlinx.serialization>
- org.junit.jupiter:junit-jupiter-api [5.9.2 -> 5.10.2]
<https://junit.org/junit5/>
- org.junit.jupiter:junit-jupiter-engine [5.9.2 -> 5.10.2]
<https://junit.org/junit5/>