我有一个多模块Maven项目,在一个模块中我想在构建期间创建两个工件:
>主要工件,它是一些jar库,其他一些模块将依赖它.
>执行一些辅助函数的可执行jar文件.没有其他模块依赖于此,它仅供用户在某些情况下手动运行.
这是我用来配置maven-assembly-plugin插件的代码:
maven-assembly-plugin
2.4
dist-assembly
package
single
bso
jar-with-dependencies
helper-${project.version}
false
HelperMain
我将appendAssemblyId设置为false,否则-jar-with-dependencies将被附加到最终名称,我不认为需要它.省略它可以提供更清晰,更易于使用的文件名.
当我运行mvn integration-test时,我收到以下警告:
[WARNING] Configuration options: ‘appendAssemblyId’ is set to false, and ‘classifier’ is missing.
Instead of attaching the assembly file: […]/target/helper-5.0.0-SNAPSHOT.jar, it will become the file for main project artifact.
NOTE: If multiple descriptors or descriptor-formats are provided for this project, the value of this file will be non-deterministic!
[WARNING] Replacing pre-existing project main-artifact file: […]/target/my.module-5.0.0-SNAPSHOT.jar
with assembly file: […]/target/helper-5.0.0-SNAPSHOT.jar
有两件事激怒了我:
>尽管警告声称它将用helper-5.0.0-SNAPSHOT.jar替换my.module-5.0.0-SNAPSHOT.jar,但它实际上并没有这样做,并且当构建完成时,两个文件仍然具有不同的大小.
>为什么有关更换工件的警告出现?
>似乎不推荐使用分类器为什么警告要求我使用它?