为什么 war:exploded 对我的 Maven 构建的输出没有影响?

Why does war:exploded make no difference to the output of my Maven build?

这两个生成完全相同的输出,通过比较目录列表验证。

mvn clean install

mvn clean war:exploded install

在每种情况下,都有 *.class 文件等的目录,以及从中生成的 *.war

因此,如果您想为您的开发环境或某些部署方案使用展开的 war,指定 war:exploded 有任何价值吗?

war:exploded

允许您指定在其中创建分解的目录。war(即在服务器部署目录中)。

mvn clean install

在 /target-dir 中创建 .class-Files 等,然后将其打包到 war-file.

因此,价值是将展开的 war-文件放在正确的位置,而不是 /target。