0

I want to copy maven dependencies to ${project.build.directory}/lib.

I am using below plugin:

         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
                <execution>
                    <id>copy-dependencies</id>
                    <phase>package</phase>
                    <goals>
                        <goal>copy-dependencies</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>${project.build.directory}/lib</outputDirectory>
                    </configuration>
                </execution>
            </executions>
        </plugin>

But this is copying jars only artifact name. Ex:

antlr-2.7.7.jar, aws-java-sdk-bundle-1.11.134.jar

Is there a way I can have groupId as well in name. Ex:

antlr.antlr-2.7.7.jar, com.amazonaws.aws-java-sdk-bundle-1.11.134.jar

Basically I need some property like:

<DependencyName>${dep.groupId}.${dep.artifactId}-${dep.version}<DependencyName>
Ana
  • 841
  • 10
  • 28

1 Answers1

0

Set <prependGroupId> to true (in the <configuration>).

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142