how to have gradle copy all the non-transitive dependencies, stripping the version number?
<p>I have a small multiproject build using Maven which I want to convert to Gradle.  I have several issues that I need to address, but I'll cover each one with a separate posting.</p>

<p>The application has three subprojects, a REST service, a front-end GUI, and a Docker image build.  We'll call these "restservice", "gui", and "image".</p>

<p>The "image" project depends on "restservice" and "gui" as it's incorporating the two WARs from those projects into the image.  It also depends on an artifact that provides a JDBC driver (this is not contained in the "restservice" WAR).</p>

<p>In order for the Gradle Docker plugin in the "image" project to work, I have to have a local folder containing the two WAR files for the "restservice" and "gui" projects, along with the JDBC jar, but with the version numbers stripped from the file names.  The Dockerfile references the artifacts without a version number.</p>

<p>So, in order to do this, in the "image" project, I need a task derived from Copy to copy my project dependencies to a folder.  You can find many variations of this task on the net, but they all copy all the dependencies, including transitive dependencies, and they copy them with the version numbers in the file name.</p>

<p>So, how do I define a Gradle task that copies only the non-transitive dependencies (the two WARs and the JDBC jar), and strips the version numbers from the file names?</p>