1.pom.xml中配置:

<build>
<finalName>项目名称</finalName>
<plugins>
<!-- 更改maven默认的打包目录 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<webappDirectory>${basedir}/src/main/webapp</webappDirectory>
<warSourceDirectory>${basedir}/src/main/webapp</warSourceDirectory>
<!-- <webResources> <resource> this is relative to the pom.xml directory 
<directory>WebContent</directory> </resource> </webResources> -->
</configuration>
</plugin>
</plugins>
</build>

2.项目右键-“Build path"-"Configure Build Path"

MAVEN配置文件生成到src/main/webapp/WEB-INF/classes目录下面MAVEN配置文件生成到src/main/webapp/WEB-INF/classes目录下面

配置输出目录为src/main/webapp/WEB-INF/classes

注意其中:

src/main/java 和src/main/resources中的Excluded 若为**,则选中,点击右边的”Remove“按钮即可。




相关文章:

  • 2021-07-31
  • 2021-05-31
  • 2021-12-26
  • 2022-01-13
  • 2022-12-23
  • 2021-12-30
  • 2021-09-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-02
  • 2022-12-23
  • 2021-07-20
  • 2021-10-30
  • 2021-04-25
相关资源
相似解决方案