Migrating from maven to gradle: ‘maven-dependency-plugin’ equivalent

Hi,

We are converting our maven project to gradle. We had used ‘maven-dependency-plugin’ to manipulate (unpack, unpack-dependencies, copy, copy-dependencies) artifacts in pom.xml.

The ‘maven-dependency-plugin’ has lot of configuration which can be done during manipulation, like stripping version, failOnMissingClassifierArtifact, overWriteIfNewer, overWriteReleases etc…

Is there a equivalent plugin in gradle which does the same?

Gradle version: 5.5

Thanks.

An example of pom.xml snippet which I’m trying to write in gradle:

        <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
                <execution>
                    <id>unpack-xsd</id>
                    <goals>
                        <goal>unpack</goal>
                    </goals>
                    <phase>generate-resources</phase>
                    <configuration>
                        <artifactItems>
                            <artifactItem>
                                <groupId>${project.groupId}</groupId>
                                <artifactId>my-art</artifactId>
                                <version>${project.version}</version>
                                <type>jar</type>
                                <outputDirectory>${project.build.directory}/my-art-out</outputDirectory>
                                <includes>**/*.xsd</includes>
                            </artifactItem>
                        </artifactItems>
                    </configuration>
                </execution>
            </executions>
        </plugin>

Here’s one more:

        <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
                <execution>
                    <id>my-ut</id>
                    <goals>
                        <goal>copy-dependencies</goal>
                    </goals>
                    <phase>process-classes</phase>
                    <configuration>
                        <outputDirectory>${project.build.directory}/</outputDirectory>
                        <includeArtifactIds>my-utils</includeArtifactIds>
                        <stripVersion>true</stripVersion>
                        <excludeTransitive>true</excludeTransitive>
                    </configuration>
                </execution>
            </executions>
        </plugin>