uploadArchives including dependencies

Hi, Is there a way to upload archives including dependencies i.e. that all the dependencies (compile and/or runtime) artifacts are as well uploaded from the remote repository into my own repository (in case the remote repository and/or library is not available anymore it is still available in my own repository)?

The only answer but which was not satisfactory I found here (from Peter Niederwieser - November 2012): http://stackoverflow.com/questions/13511802/publish-dependencies-of-an-artifact-with-gradle … There isn’t currently an easy way to achieve this with Gradle; you’ll have to script your own solution. In particular, you’ll have to find a way to recreate the original POM when publishing the archive…

How can I solve this problem or can you maybe provide a script that solves this problem?

Thank you