How to move a dependency with specific suffix to a folder in war plugin


axis2 requires .mar files (modules) to be stored in a /modules folder within the resulting war file. The mar file is currently available as a dependency, and thus resides in WEB-INF/lib . I would like to have it moved to /modules.

axis2 jaxws-samples uses maven and does it like this:


What would the alternative be in Gradle? I’m pretty new at Gradle, using Kotlin DSL, and having difficulties finding the correct way to do this. Any help is very much appreciated.

Looking into this more myself and including possible solution for whoever may be interested.

In distributions plugin one can configure Distribution object with contents which is CopySpec typed. CopySpec allows to configure copy and rename rules for the distribution. Will try to implement this later.

edit: noticed CopySpec rename possibilities in jar task as well, so I guess that would be the place to check for jar generation.