Configure Repository per Configuration

Is it possible to configure repositories per configuration.

For example I have a project with configuration A and B.

I want to force that all dependencies from configuration A will be downloaded from Repository A. And all dependencies from configuration B from Repository B.