简体   繁体   English

maven包阶段创建的war文件和maven war plugin war:war目标创建的war文件之间有什么区别吗?

[英]Is there any difference between war file created by maven package phase and war file created by maven war plugin war:war goal

I would to know if a war file created using maven package phase would be equal to a war file created using maven war plugin war:war goal. 我想知道使用maven包阶段创建的war文件是否等于使用maven war plugin war:war goal创建的war文件。

Assuming we have a pom.xml (extract) like this: 假设我们有一个像这样的pom.xml(提取):

<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>

 ...
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.4</version>
        <configuration>
          <webappDirectory>/sample/servlet/container/deploy/directory</webappDirectory>
        </configuration>
      </plugin>
    </plugins>
  </build>
  ...

I mean, it's necessary to have the plugin to build a war file (with no special restriction or feature). 我的意思是,有必要使用插件来构建war文件(没有特殊限制或功能)。 Please fee free to add any comment or suggestion. 请免费添加任何评论或建议。 Thanks in advance 提前致谢

They are absolutelly equal. 他们绝对平等。 The purpose of plugin block with maven-war-plugin description is - for example - change default webappDirectory value. plugin块与maven-war-plugin描述的目的是 - 例如 - 更改默认的webappDirectory值。 See more: http://maven.apache.org/plugins/maven-war-plugin/usage.html 查看更多: http//maven.apache.org/plugins/maven-war-plugin/usage.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM