如何控制maven assembly插件的输出存档路径?

How to control the output archive path of maven assembly plugin?

似乎 maven 程序集插件总是输出到 ${project.dir}/target 而不管我设置的所有描述符字段。 maven assembly 插件是否支持此功能?

您当然可以通过为 outputDirectory 使用正确的配置来更改该行为,如下所示:

<plugin>
  <groupId>org.apache.maven.plugin</groupId>
  <artifactId>maven-assembly-plugin</artifactId>
  <version>2.5.5</version>
  <configuration>
    <outputDirectory>TheLocationYouLike</outputDirectory>
    ..
  </configuration>
</plugin>

但我不建议这样做,因为它违反了配置范式的惯例。