Download dependencies custom task

Hello,
I am looking into creating a custom task that will create a local repository. The idea would be to get the dependencies, group, artifact id, etc and create the folder struture /artifact/group/artifactid with the jar and the pom inside the folder.
I have been researching but I don’t find anything like this.
Is this possible?
Thanks