fm-sbt-s3-resolver icon indicating copy to clipboard operation
fm-sbt-s3-resolver copied to clipboard

`s3CredentialsProvider` is no longer respected with SBT 1.3.x/Coursier

Open stephenjudkins opened this issue 5 years ago • 7 comments

We recently upgraded from SBT 1.2.8 to 1.3.8 and saw the following regression:

In our primary build.sbt, we defined a custom s3CredentialsProvider. In 1.2.8, this was evaluated and called and seemed to work. With 1.3.8, when Coursier is enabled, the custom s3CredentialsProvider is never called (though the setting itself appears to be evaluated at a later point). Debugging shows that, when https://github.com/frugalmechanic/fm-sbt-s3-resolver/blob/master/src/main/scala/fm/sbt/S3ResolverPlugin.scala#L123 runs, the s3CredentialsProvider that is defined in the root built.sbt is not yet initialized/visible.

stephenjudkins avatar Mar 25 '20 22:03 stephenjudkins

A workaround we found is to define our custom s3CredentialsProvider in project/plugins.sbt

harpocrates avatar Mar 25 '20 23:03 harpocrates

I'll try to play around with this when I have a chance.

@stephenjudkins Are you saying that if you disable Coursier in SBT 1.3.8 then s3CredentialsProvider works as expected?

tpunder avatar Mar 26 '20 03:03 tpunder

Yep. With (useCoursier in Global) := false it works as before; with Coursier enabled we had to move our custom s3CredentialsProvider to project/plugins.sbt to get it to work.

stephenjudkins avatar Mar 26 '20 16:03 stephenjudkins

@stephenjudkins I see SBT 1.3.9 just got released with some classpath changes for Coursier. Does that make things start working or does the bug persist?

tpunder avatar Mar 31 '20 17:03 tpunder

The bug persists in 1.3.9.

harpocrates avatar Apr 01 '20 12:04 harpocrates

This seems worse with SBT 1.5.5, now not even having s3CredentialsProvider in project/plugins.sbt works. The only way I'm able to get this working is to add Global / useCoursier := false. Any ideas, @tpunder?

therockstorm avatar Aug 23 '21 15:08 therockstorm

@therockstorm do you have an example of the custom provider?

er1c avatar Dec 16 '21 19:12 er1c