maven依赖项使用timestamp后缀重命名jar

时间:2013-07-26 08:04:02

标签: maven

使用依赖插件复制时,快照jar后缀为时间戳。

有谁知道出了什么问题?

[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>

2 个答案:

答案 0 :(得分:11)

更新到插件版本2.8并将选项useBaseVersion设置为true

从命令行:

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

(感谢Jens Kreidler

答案 1 :(得分:1)

坚持<uniqueVersion>false</uniqueVersion>