This message was deleted.
# community-support
s
This message was deleted.
c
hmm. only difference from a working config is
.all
vs
.configureEach
(eager vs lazy, which isn’t material for configurations).
Copy code
configurations.all {
        if (state == Configuration.State.UNRESOLVED) {
            resolutionStrategy {
                // force latest.release (and other dynamic versions) to refresh
                // this allows for emergency changes, like realigning artifact versions with CVEs
                cacheDynamicVersionsFor(2, TimeUnit.HOURS)

                // snapshots
                cacheChangingModulesFor(5, TimeUnit.MINUTES)
            }
        }
    }
c
🤦
should I have a 2nd one? and is dynamic versions snapshots or is that changing modules?
like one with configure each for the other stuff?
c
changing modules is snapshots, e.g. `-SNAPSHOT`releases. dynamic versions is
1.+
, for example.
note this will work for dependencies in the dependencies block - not plugin dependencies, for that you need to repeat in a buildscript block.
c
thought so, plugins isn't a problem fortunately
c
lucky you 😉
should be able to do all your stuff in
configurations.all
c
thanks, why are we checking state unresolved there?
what does that achieve?
what are the consequences of the if
c
fixes interactions with other plugins that may use their own configurations and resolve them earlier, which causes an exception if you then try to tweak the config. no harm in leaving it there, it works in all the normal cases.
c
ah, yeah, just wasn't sure what it meant 😉
urgh.. it's still not getting the local snapshots. I"ve tried blowing away my ~/.gradle directory and it's still getting from the remote
there's even one jar that's only local that it's not getting
only thing that seems suspect is the jar's are marked 1.8 or 11 in the maven-local.pom (or whatever) in the ~/.m2
shouldn't it search maven local first?
c
Have u defined mavenLocal as a repo?
c
sorry, I got drug into a super long meeting
isn't that what the code is doing? also I finally got it to output this error.
seems to be getting those from java.toolchain.version ... but why would that affect the version output. I just removed that and it's fine now
oh, it's
languageVersion
. Yay SCOPE!