[英]How to tell IntelliJ to use folder “web” instead of “webapp” for maven when building a war file?
What I do is: 我要做的是:
Well build fails, because maven is looking for a webapp directory instead of a directory called web . 构建失败,因为maven正在寻找一个webapp目录而不是一个名为web的目录。 For building the project. 用于构建项目。
So, if I rename the folder web to webapp build goes fine. 因此,如果我将文件夹Web重命名为webapp,构建就可以了。
However, I want to learn more about IntelliJ and maven, so I want to force maven to use the folder web . 但是,我想了解有关IntelliJ和maven的更多信息,所以我想强制maven使用文件夹web 。 How can I properly do this 我该如何正确地做到这一点
Regards. 问候。
You can configure this in the pom.xml file for your project. 您可以在项目的pom.xml文件中进行配置。
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<warSourceDirectory>web</warSourceDirectory>
</configuration>
</plugin>
</plugins>
You can find the documentation here 您可以在这里找到文档
If IntelliJ behaves as expected, it should pick up this new configuration. 如果IntelliJ的行为符合预期,则应选择此新配置。
Have a look at this post , which explains how to change the default webapp
directory: 看一下这篇文章 ,其中说明了如何更改默认的webapp
目录:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<warSourceDirectory>web</warSourceDirectory>
</configuration>
</plugin>
</plugins>
</build>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.