0
votes

I'm using maven-dependency-plugin to copy dependency jars into specific folder. I'm looking the way to customize copied jar file names using dependency properties: groupid, artifactid and version.

example:

I have following dependency

<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-lang3</artifactId>
    <version>3.3.2</version>
</dependency>

I'd like to copy dependency jar as "org.apache.commons.commons-lang3-3.3.2.jar"

How can I accomplish this?

1

1 Answers

1
votes

I was able to achieve this using "prependGroupId" parameter.

Sample configuration snippet:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.10</version>
        <executions>
            <execution>
                <id>copy-dependencies</id>
                <phase>package</phase>
                <goals>
                    <goal>copy-dependencies</goal>
                </goals>
                <configuration>
                    <prependGroupId>true</prependGroupId>
                </configuration>
            </execution>
        </executions>
    </plugin>