I have a maven project with 5 dependencies. Two of them (with its transitive dependencies) I need to have in a custom location, let's say in client/plugins
. While rest of the project dependencies (also with transitive dependencies) I need in another location, let's say in client/modules
. Following examples from Apache Maven documentation, here's my <build>
block:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
</execution>
</executions>
<configuration>
<artifactItems>
<artifactItem>
<groupId>my.groupid</groupId>
<artifactId>my-artifactid-one</artifactId>
<version>1.0-SNAPSHOT</version>
<outputDirectory>client/modules</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>my.groupid</groupId>
<artifactId>my-artifactid-one</artifactId>
<version>1.1-SNAPSHOT</version>
<outputDirectory>client/modules</outputDirectory>
</artifactItem>
</artifactItems>
<outputDirectory>client/plugins</outputDirectory>
</configuration>
</plugin>
</plugins>
</build>
When I run mvn -U clean package
command, Maven copies all project dependencies with its transitive dependencies to client/plugins
. Thus, it ignores configurations I've set up for specific artifacts.
How can I set it up?