Maven:在 war:exploded 之前清理 webapp 目录?
引用 maven war 插件使用页面:
<project>
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<webappDirectory>/sample/servlet/container/deploy/directory</webappDirectory>
</configuration>
</plugin>
</plugins>
</build>
...
</project>
如何清理分解 war 文件之前
中定义的目录内容?
根据我的经验,定义为 webappDirectory 的文件夹不会被清理,因此将包含属于 webapp 一部分的不相关文件。
如果我可以在当前用于清理 webappDirectory 的命令中添加一些内容,那就太酷了,就像这样:
mvn -o clean <cleanWebappDirectory here?> install war:exploded
谢谢!
quoting from maven war plugin usage page :
<project>
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<webappDirectory>/sample/servlet/container/deploy/directory</webappDirectory>
</configuration>
</plugin>
</plugins>
</build>
...
</project>
How do i clean the content of the directory defined in the <webappDirectory>/sample/servlet/container/deploy/directory</webappDirectory>
before exploding the war file ?
In my experience, the folder defined as the webappDirectory wont get cleaned, and so will have nonrelated files that was part of the webapp.
It'll be cool if i can add something to the current command im currently using to clean the webappDirectory, which is something like this :
mvn -o clean <cleanWebappDirectory here?> install war:exploded
Thank you !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能需要考虑添加 maven clean 插件,指定必需的文件夹进行清洁。如下所示...请注意,
目录
应该是相对的。You may want to look at adding the maven clean plugin, specifying the requisite folder to be cleaned. Something like below... Note that the
directory
should be relative.