How to copy a dependency inside a war using dependency group, name, version for target location?

I have a configuration with dependencies:

configurations {
    libsJS
}

dependencies {
    libsJS "io.deps:artefact1:1.1.1"
    libsJS "io.deps:artefact2:1.0.1"
}

During a war task I want to put the dependency content (zipTree?) in a specific folder:

lib-js/io.deps/artefact1/1.1.1

I can I do that?