Extract file from jar dependency defined against maven repo

configurations {
   stuffCommon { transitive = false } 
} 
dependencies {
   stuffCommon 'com.mycompany:stuff-common:1.0' 
} 
task unzip(type: Copy) {
   from zipTree(configurations.stuffCommon.singleFile).matching {
      include 'foo.txt'
      include 'bar.txt'
   } 
   into "$buildDir/unzipped" 
}