Skip to content
This repository was archived by the owner on May 22, 2022. It is now read-only.

Config scope: dependencyOverrides in Compile (not Test)#30

Merged
tkawachi merged 1 commit intotkawachi:masterfrom
htmldoug:inCompile
Oct 7, 2019
Merged

Config scope: dependencyOverrides in Compile (not Test)#30
tkawachi merged 1 commit intotkawachi:masterfrom
htmldoug:inCompile

Conversation

@htmldoug
Copy link
Copy Markdown
Contributor

@htmldoug htmldoug commented Oct 1, 2019

Problem

Currently we have:
src/main/scala -> jackson-databind 2.7.x
src/test/scala -> jackson-databind 2.9.x

sbt lock chooses the 2.7.x version and sets for all configurations (including Test). Our tests which depend on 2.9.x fail since they require a method that does not exist.

04:03:19 sbt.ForkMain$ForkError: java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/deser/std/ReferenceTypeDeserializer
04:03:19 	at java.lang.ClassLoader.defineClass1(Native Method)
04:03:19 	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
04:03:19 	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
04:03:19 	at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
04:03:19 	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
04:03:19 	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
04:03:19 	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
04:03:19 	at java.security.AccessController.doPrivileged(Native Method)
04:03:19 	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
04:03:19 	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
04:03:19 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
04:03:19 	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
04:03:19 	at com.fasterxml.jackson.datatype.guava.GuavaModule.setupModule(GuavaModule.java:55)
04:03:19 	at com.fasterxml.jackson.databind.ObjectMapper.registerModule(ObjectMapper.java:730)
04:03:19 	at com.spotify.docker.client.ObjectMapperProvider.<clinit>(ObjectMapperProvider.java:74)

Solution

This PR restricts the dependencyOverrides to only the Compile scope, since that seems to be where they're describing.

@htmldoug
Copy link
Copy Markdown
Contributor Author

htmldoug commented Oct 1, 2019

cc: @rallydan

@htmldoug
Copy link
Copy Markdown
Contributor Author

htmldoug commented Oct 1, 2019

Build is unhappy.

@tkawachi
Copy link
Copy Markdown
Owner

tkawachi commented Oct 6, 2019

Thank you for PR. Cloud you rebase on master branch?

@htmldoug
Copy link
Copy Markdown
Contributor Author

htmldoug commented Oct 6, 2019

Done. Thanks, @tkawachi!

Also, this relates to #28. fyi, @stephanos.

@tkawachi tkawachi merged commit 18ca296 into tkawachi:master Oct 7, 2019
@jtjeferreira
Copy link
Copy Markdown
Contributor

jtjeferreira commented Oct 28, 2020

after this change, I get in sbt 1.4.1

[warn] there are 31 keys that are not used by any other settings/tasks:
[warn]  
[warn] * integrations / Compile / dependencyOverrides
[warn]   +- /home/joao/git/project/modules/integrations/lock.sbt:4
...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants