Gradle tries to fetch an artifact with the wrong classifier


(Scott Palmer) #1

Running Gradle 2.12 on Windows 7 with Java 8u72
I have uploaded a bunch of MSI merge modules to our local Artifactory repository. These are for Visual C/C++ runtimes. My product needs to install several different versions of the VC runtime, so it depends on many versions.
I have declared these dependencies in my build.gradle file:

configurations {
    vcruntime
}

dependencies {
	// vcruntime group: 'com.microsoft', name:'Microsoft_VC', version:'90', classifier:'CRT_x86_x64', ext:'msm'
	// vcruntime group: 'com.microsoft', name:'Microsoft_VC', version:'90', classifier:'policy_CRT_x86_x64', ext:'msm'
	// vcruntime group: 'com.microsoft', name:'Microsoft_VC', version:'90', classifier:'ATL_x86_x64', ext:'msm'
	// vcruntime group: 'com.microsoft', name:'Microsoft_VC', version:'90', classifier:'policy_ATL_x86_x64', ext:'msm'
	// vcruntime group: 'com.microsoft', name:'Microsoft_VC', version:'120', classifier:'CRT_x86', ext:'msm'
	// vcruntime group: 'com.microsoft', name:'Microsoft_VC', version:'120', classifier:'CRT_x64', ext:'msm'
	vcruntime group: 'com.microsoft', name:'Microsoft_VC', version:'140', classifier:'CRT_x86', ext:'msm'
	vcruntime group: 'com.microsoft', name:'Microsoft_VC', version:'140', classifier:'CRT_x64', ext:'msm'
}

I get this error if I uncomment the commented out dependencies:

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\dev\RuntimeTest\build.gradle' line: 33

* What went wrong:
Execution failed for task ':generateWixForVCMergeModules'.
> Could not resolve all dependencies for configuration ':vcruntime'.
   > Could not find Microsoft_VC-CRT_x86_x64.msm (com.microsoft:Microsoft_VC:140).
     Searched in the following locations:
         http://myartifactoryserver/repo/com/microsoft/Microsoft_VC/140/Microsoft_VC-140-CRT_x86_x64.msm

Note the use of the wrong classifier! (The Visual C 9.0 runtime uses a CRT_x86_x64 classifier, but the later versions have separate files for CRT_x86 and CRT_x64.)


(Scott Palmer) #2

I see that I will have to deal with version conflict resolution as well. That seems to be the root of the problem. How can I get several different versions of the same asset?


(Schalk Cronjé) #3

One way is to declare multiple configurations i.e. vcruntime64 and vcruntime32.


(Scott Palmer) #4

Thanks, that helps get around the issue for now.

It would be better if I could specify a ResolutionStrategy that allows for all of the different asset versions to end up in the same configuration.
I guess this isn’t a bug, but it has become a feature request :slight_smile: