Skip to content

Commit

Permalink
support for ./gradlew build -PmavenLocal or -PmavenLocal=last
Browse files Browse the repository at this point in the history
  • Loading branch information
codeconsole committed Dec 20, 2024
1 parent 0a7af8f commit 37cb970
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,19 @@ ext {
grailsVersion = grailsVersionList[0]
}

subprojects {
subprojects { prj ->
configurations.all {
// check for updates every build
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}

String useMavenLocal = project.findProperty('mavenLocal')
repositories {
if (useMavenLocal || useMavenLocal != 'last') {
println "Using mavenLocal() first on project `${prj.name}`"
mavenLocal()
}

maven { url "https://repo.grails.org/grails/core" }
mavenCentral()
if(groovyVersion.endsWith('-SNAPSHOT')) {
Expand All @@ -32,6 +38,10 @@ subprojects {
url = 'https://repository.apache.org/content/repositories/snapshots'
}
}
if (useMavenLocal == 'last') {
println "Using mavenLocal() last on project `${prj.name}`"
mavenLocal()
}
}

tasks.withType(Test) {
Expand Down

0 comments on commit 37cb970

Please sign in to comment.