Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maven dependency rename jar with timestamp suffix

Tags:

maven

The snapshot jars are suffixed with timestamp when using dependency plugin to copy them.

Does anyone know what went wrong?

[INFO] --- maven-dependency-plugin:2.5.1:copy-dependencies (copy-dependencies) @ pdfsec ---
[INFO] Copying test-3.5.9-SNAPSHOT.jar to test-3.5.9-20130726.002521-6.jar

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.5.1</version>
            <executions>
                <execution>
                    <id>copy-dependencies</id>
                    <phase>initialize</phase>
                    <goals>
                        <goal>copy-dependencies</goal>
                    </goals>
                    <configuration>
                        <useSubDirectoryPerScope>true</useSubDirectoryPerScope>
                        <overWriteSnapshots>true</overWriteSnapshots>
                        <overWriteIfNewer>true</overWriteIfNewer>
                        <excludeArtifactIds>unboundid-ldapsdk</excludeArtifactIds>
                    </configuration>
                </execution>
            </executions>
        </plugin>
like image 901
tompal18 Avatar asked Jul 26 '13 08:07

tompal18


2 Answers

Update to version 2.8 of the plugin and set the option useBaseVersion to true.

From the commandline:

mvn dependency:copy -Dmdep.useBaseVersion=true -Dartifact=x:y:z:p:c ...

(kudos to Jens Kreidler)

like image 50
Aaron Digulla Avatar answered Oct 29 '22 00:10

Aaron Digulla


Stick <uniqueVersion>false</uniqueVersion> in there.

like image 1
stolsvik Avatar answered Oct 28 '22 23:10

stolsvik