1

当我使用

<plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                **<version>2.3</version>**
                <configuration>
                     <descriptorRefs>
                           <descriptorRef>jar-with-dependencies</descriptorRef>
                     </descriptorRefs>
                </configuration>
            </plugin>

我发现当我不使用版本标签时,我收到了完全不同的 jar。此外,当我不指定版本时,某些文件甚至在 jar 中重复。

为什么?

4

1 回答 1

1

If you don't give an explicit version in your pom Maven uses the version which is defined by the super pom which comes with the maven version you have installed and that is usually a one which is older and might have problems or might not support the functionality you need. This results in defining all the time a version explicit or use a parent pom which defines the versions of the plugins to have a reproducible build.

于 2012-06-07T16:04:37.483 回答